psql - looking in wrong place for socket

From: Steve Clark <steve(dot)clark(at)netwolves(dot)com>
To: pgsql <pgsql-general(at)postgresql(dot)org>
Subject: psql - looking in wrong place for socket
Date: 2017-03-17 13:42:31
Message-ID: 481feb63-cfa7-7125-0911-01d72399b854@netwolves.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi List,

I am running postgresql 8.4.20 on CentOS 6. Things have been running fine for a long time
then I rebooted. Postgres came up but when I tried to connect with psql on the local machine
I got

psql: 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"?

The socket is actually being created (and always has been) in /tmp

I worked around the problem temporarily by
ln -s /tmp/.s.PGSQL.5432 /var/run/postgresql/.s.PGSQL.5432

What controls where psql looks for the socket?

Thanks,
Steve

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2017-03-17 13:49:25 Re: psql - looking in wrong place for socket
Previous Message Adrian Klaver 2017-03-17 13:39:24 Re: pg_dump pg_restore hanging in CentOS for large data