Re: Starting PostgreSQL - Mailing list pgsql-general

From Marco Colombo
Subject Re: Starting PostgreSQL
Date
Msg-id 48F2901B.9030902@esiway.net
Whole thread Raw
In response to Starting PostgreSQL  (admin <mick@mjhall.org>)
List 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.

pgsql-general by date:

Previous
From: "Grzegorz Jaśkiewicz"
Date:
Subject: Re: PQexecParams question
Next
From: Martin Gainty
Date:
Subject: Re: Need schema design advice