Re: Psql: could not connect to server: No such file or directory

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: SAMMY CRISWELL <Sammy_R_Criswell(at)raytheon(dot)com>
Cc: pgsql-admin <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Psql: could not connect to server: No such file or directory
Date: 2019-05-02 17:07:44
Message-ID: 2606.1556816864@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

SAMMY CRISWELL <Sammy_R_Criswell(at)raytheon(dot)com> writes:
> I am preparing to upgrade my pqsl server from 9.3.5 to 9.6.12. I have installed the 9.6 rpm onto the server that has 9.3.5 running. Postgres is still running 9.3.5 on that server, but when I try to run psql I get the following message.

> "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 database is still running and working I just can't use any of the client commands like psql, pg_dump....
> And there is no "/var/run/postgresql/.s.PGSQL.5432" file.

What you've probably run into here is that some packagers build Postgres
to put the server's socket file into /tmp, while others build it to put
the socket into /var/run/postgresql/ or some similar path. Likely,
you are now using a new version of libpq.so that expects the latter
while your server is still doing the former. You can override libpq's
default with "-h /tmp" or equivalent in order to connect.

regards, tom lane

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message robert 2019-05-02 18:34:03 Re: Psql: could not connect to server: No such file or directory
Previous Message Mark Steben 2019-05-02 16:36:14 Re: vacuum of pg_attribute and other infrastructure tables