Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql General > Re: Problem. cr...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 1 Topic 15266 of 17602
Post > Topic >>

Re: Problem. createdb: could not connect to database postgres: could not connect to server: No such file or directory

by dalroi@[EMAIL PROTECTED] (Alban Hertroys) Apr 12, 2008 at 12:28 PM

On Apr 12, 2008, at 7:11 AM, Jaisen N.D. wrote:
> localhost:/home/user# su - postgres
> postgres@[EMAIL PROTECTED]
 /usr/lib/postgresql/8.1/bin/initdb -D /var/ 
> lib/postgresql/data
> The files belonging to this database system will be owned by user  
> "postgres".
> This user must also own the server process.
>
> The database cluster will be initialized with locale en_IN.
> The default database encoding has accordingly been set to UTF8.
>
> initdb: directory "/var/lib/postgresql/data" exists but is not empty
> If you want to create a new database system, either remove or empty
> the directory "/var/lib/postgresql/data" or run initdb
> with an argument other than "/var/lib/postgresql/data".

It says right here. You forgot to move your old data directory out of  
the way. As it's from a Postgres 8.3 installation, Postgres 8.1 has  
no way of knowing how to handle what's in there.

> postgres@[EMAIL PROTECTED]
 /usr/lib/postgresql/8.1/bin/pg_ctl -D /var/ 
> lib/postgresql/data -l logfile start
> postmaster starting
> postgres@[EMAIL PROTECTED]
 /usr/lib/postgresql/8.1/bin/createdb test
> createdb: could not connect to database postgres: could not connect  
> to server: No such file or directory
>         Is the server running locally and accepting
>         connections on Unix domain socket "/var/run/ 
> postgresql/.s.PGSQL.5432"?
> postgres@[EMAIL PROTECTED]
> -----------------------------------------------------
> Why it can't connect to server? How can I resolve it??


Because initialisation of the database (initdb) failed for the  
aforementioned reason. There are probably some messages in your logs  
about postgres failing to start or to operate on its data directory.  
You can't just run a different major version of postgres on an  
existing data directory.

You didn't tell what your goal is. Are you trying to downgrade an  
existing database? If so, why would you want to do that?

Alban Hertroys

--
If you can't see the forest for the trees,
cut the trees and you'll see there is no forest.


!DSPAM:737,48008eed927663372713408!



-- 
Sent via pgsql-general mailing list (pgsql-general@[EMAIL PROTECTED]
)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
 




 1 Posts in Topic:
Re: Problem. createdb: could not connect to database postgres: c
dalroi@[EMAIL PROTECTED]   2008-04-12 12:28:56 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Mon Dec 1 19:18:19 CST 2008.