View Single Post

   
  #1 (permalink)  
Old 04-15-2008, 08:33 PM
Craig Ringer
 
Posts: n/a
Default Re: Problem. createdb: could not connect to database postgres:

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@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

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

Reply With Quote