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

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: "Jaisen N(dot)D(dot)" <jaisuvyas(at)gmail(dot)com>
Cc: Craig Ringer <craig(at)postnewspapers(dot)com(dot)au>, 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-19 09:23:16
Message-ID: 20080419092316.GA32096@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)svana(dot)org> http://svana.org/kleptog/
> Please line up in a tree and maintain the heap invariant while
> boarding. Thank you for flying nlogn airlines.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message David Fetter 2008-04-19 11:18:08 Re: I need to ecrypt one column to an output file
Previous Message Anton Andreev 2008-04-19 08:33:59 very slow updates in 8.3?