Re: Problem. createdb: could not connect to database postgres: could not connect to server: No such file or directory - Mailing list pgsql-general

From Martijn van Oosterhout
Subject Re: Problem. createdb: could not connect to database postgres: could not connect to server: No such file or directory
Date
Msg-id 20080419092316.GA32096@svana.org
Whole thread Raw
In response to Re: Problem. createdb: could not connect to database postgres: could not connect to server: No such file or directory  ("Jaisen N.D." <jaisuvyas@gmail.com>)
List pgsql-general
On Sat, Apr 19, 2008 at 10:14:00AM +0530, Jaisen N.D. wrote:
> Hi., Sorry for my late reply, I wasn't on desk for last few days. My goal is
> to set up a spatial database, with postgresql 8.1. I removed the postgresql
> installation using apt-get --purge remove. and removed the
> var/lib/postgresql/data directory. And then reinstalled it again. The result
> I got is here:-

Why are you creating a database here:
> --------------------------------------
> I created data folder again. But When I tried to create a test database, I
> couldn't. Here is the steps I followed:-
> --------------------------------------
> localhost:/home/user# adduser postgres
> adduser: The user `postgres' already exists.
> localhost:/home/user# mkdir /var/lib/postgresql/data
> localhost:/home/user# chown postgres /var/lib/postgresql/data
> localhost:/home/user# su - postgres

When it told you it already created one and it's already running.
> Creating new cluster (configuration: /etc/postgresql/8.1/main, data:
> /var/lib/po stgresql/8.1/main)...

<snip>

> Configuring postgresql.conf to use port 5432...
> Starting PostgreSQL 8.1 database server: main.

Delete directory just created and do this as root:

su - postgres
createuser <your username>
# Say you wanto to be superuser
createdb <database name>

> Where is the problem??
> The logfile in home folder of postgres user is as follows:-
> --------------------------------------
>  LOG:  could not bind IPv4 socket: Address already in use
> HINT:  Is another postmaster already running on port 5432? If not, wait a
> few seconds and retry.

Use the server already running, instead of making another one.

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Please line up in a tree and maintain the heap invariant while
> boarding. Thank you for flying nlogn airlines.

Attachment

pgsql-general by date:

Previous
From: Anton Andreev
Date:
Subject: very slow updates in 8.3?
Next
From: David Fetter
Date:
Subject: Re: I need to ecrypt one column to an output file