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

From: Craig Ringer <craig(at)postnewspapers(dot)com(dot)au>
To: "Jaisen N(dot)D(dot)" <jaisuvyas(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Problem. createdb: could not connect to database postgres: could not connect to server: No such file or directory
Date: 2008-04-12 06:36:08
Message-ID: 48005858.7020003@postnewspapers.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Jaisen N.D. wrote:
> Hai, I use Debian Etch. I have a problem with postgresql 8.1. I have
> uninstalled the postgresql-8.3, which I was took from debian back ports,
> removed its configuration files, and the user postgres also.
It sounds like you didn't remove the data directory,
/var/lib/postgresql/data .

By the way, if you want to remove all configuration etc along with a
package you should use apt-get --purge remove .
> 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".
>
initdb could not create a database cluster because there were files in
/var/lib/postgresql/data . You should rename the `data' directory to
something else or remove it. Removing it will destroy your database.

PostgreSQL 8.1 cannot read data from PostgreSQL 8.3 .

> postgres(at)localhost:~$ /usr/lib/postgresql/8.1/bin/pg_ctl -D
> /var/lib/postgresql/data -l logfile start
> postmaster starting
>
If you have a look at the postgresql logs you will see that postgresql
failed to start because it cannot read the data in the data directory;
it is for the wrong version of postgresql.

--
Craig Ringer

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Alban Hertroys 2008-04-12 10:28:56 Re: Problem. createdb: could not connect to database postgres: could not connect to server: No such file or directory
Previous Message Jaisen N.D. 2008-04-12 05:11:58 Problem. createdb: could not connect to database postgres: could not connect to server: No such file or directory