Re: Starting PostgreSQL

From: Marco Colombo <pgsql(at)esiway(dot)net>
To: admin <mick(at)mjhall(dot)org>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Starting PostgreSQL
Date: 2008-10-13 00:02:35
Message-ID: 48F2901B.9030902@esiway.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

admin wrote:
> Sorry folks, a perennial one I'm sure ...
>
> I have read the manual and Googled for a couple of hours but still can't
> connect to PostgreSQL 8.3.4 (the PGDG RPMs running on an up to date
> CentOS 5.2).
>
> I continually get this message:
>
> psql: could not connect to server: No such file or firectory
> Is the server running locally and accepting
> connections on Unix domain socket "/tmp/.s.PDSQL.0"?
>
> Yes, the server is running as 'ps -aux' and 'netstat -l' and 'service
> postgresql status' all confirm.

Do you mean you have something like this in your netstan -l?
unix 2 [ ACC ] STREAM LISTENING 12587 /tmp/.s.PGSQL.5432

note, this is on a linux box with postgresql in standard configuration.
Just look at the port number embedded in the socket name. I don't really
think you can run a process on port 0. I think your psql is looking for
the wrong socket.

Try:
$ psql -p 5432 ...

If you don't see any unix socket for PG (I don't even think that's possible),
then you need to use IP sockets:

$ psql -p 5432 -h localhost ...

>
> service postgresql start/stop/restart works without errors
> pg_ctl start/stop/restart works without errors
>
> There is no socket file in /tmp.

Opps sorry I missed this. Well double check with netstat, but it's
possible your PG is not configured for Unix sockets... even if I
wouldn't know how to do that.

I just checked a CentOS5.2 running PG and there it is:

$ ls -l /tmp/.s.PGSQL.5432
srwxrwxrwx 1 postgres postgres 0 Oct 13 01:22 /tmp/.s.PGSQL.5432

.TM.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Martin Gainty 2008-10-13 00:51:46 Re: Need schema design advice
Previous Message Grzegorz Jaśkiewicz 2008-10-12 23:28:11 Re: PQexecParams question