Received: from localhost (unknown [200.46.204.184]) by developer.postgresql.org (Postfix) with ESMTP id 4D01C2E002E for ; Sat, 12 Apr 2008 07:00:18 -0300 (ADT) Received: from developer.postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 92676-03 for ; Sat, 12 Apr 2008 07:00:06 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from ciao.gmane.org (main.gmane.org [80.91.229.2]) by developer.postgresql.org (Postfix) with ESMTP id 64D0E2E002C for ; Sat, 12 Apr 2008 07:00:10 -0300 (ADT) Received: from root by ciao.gmane.org with local (Exim 4.43) id 1JkcWg-0001p9-U6 for pgsql-admin@postgresql.org; Sat, 12 Apr 2008 10:00:02 +0000 Received: from crypt.ethx.net ([82.165.27.140]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 12 Apr 2008 10:00:02 +0000 Received: from sam by crypt.ethx.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 12 Apr 2008 10:00:02 +0000 X-Injected-Via-Gmane: http://gmane.org/ To: pgsql-admin@postgresql.org From: Sam Morris Subject: Re: Problem:- createdb: could not connect to database postgres: could not connect to server: No such file or directory Date: Sat, 12 Apr 2008 09:48:44 +0000 (UTC) Lines: 56 Message-ID: References: <7db916da0804112227p5b523629m18c949abf41c1f02@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: crypt.ethx.net User-Agent: Pan/0.132 (Waxed in Black) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200804/105 X-Sequence-Number: 28869 On Sat, 12 Apr 2008 10:57:28 +0530, 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. Then > installed postgresql-8.1. But when I started to create a database, it > shows some message like this.. > Here is the output I got:- > ----------------------------------------------------- > localhost:/home/user# su - postgres > postgres@localhost:~$ /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". postgres@localhost:~$ > /usr/lib/postgresql/8.1/bin/pg_ctl -D /var/lib/postgresql/data -l > logfile start postmaster starting > postgres@localhost:~$ /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@localhost:~$ > ----------------------------------------------------- Why it can't > connect to server? How can I resolve it?? Debian uses /var/lib/postgresql/$pgversion/$clustername to store its clusters. It doesn't use /var/lib/postgresql/data as far as I know. So I suggest you move it aside and try again. You should really be using the pg_createcluster command however. Then you will have a cluster correctly located so that Debian's initscripts will start and stop the server at startup and shutdown. You can also use pg_lsclusters to see what clusters (if any) were left behind by your previous install of 8.3. Finally, I suggest you read /usr/share/doc/postgresql-common/ README.Debian.gz for an overview of how the Debian packages of postgresql integrate with the rest of the system. -- Sam Morris http://robots.org.uk/ PGP key id 1024D/5EA01078 3412 EA18 1277 354B 991B C869 B219 7FDB 5EA0 1078