On Apr 12, 2008, at 7:11 AM, Jaisen N.D. wrote:
localhost:/home/user# su - 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.

[EMAIL PROTECTED]:~$ /usr/lib/postgresql/8.1/bin/pg_ctl -D /var/ lib/postgresql/data -l logfile start
postmaster starting
[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"?
[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@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Reply via email to