Re: psql can't connect to old DB after installing new binaries

From: Jerry Sievers <gsievers19(at)comcast(dot)net>
To: Don Seiler <don(at)seiler(dot)us>
Cc: pgsql-admin <pgsql-admin(at)postgresql(dot)org>
Subject: Re: psql can't connect to old DB after installing new binaries
Date: 2017-10-04 20:09:59
Message-ID: 878tgqptd4.fsf@jsievers.enova.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Don Seiler <don(at)seiler(dot)us> writes:

> CentOS 6. I have a box with 9.2 installed and running, planning to
> upgrade to 9.6. All packages are from the postgresql yum repos, not
> the CentOS base repos.
>
> However, after installing the 9.6 binaries, psql complains about the
> socket file:
>
> 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"?

Try PGHOST=/tmp psql ...

Or psql -h /tmp -p $port...

ISTM your newer libpq is now being used and as seen above it's built
with a different default socket file location.

>
> My postgres 9.2 database has a socket file in /tmp/.s.PGSQL.5432.
> What's interesting is that I get this error even when running the 9.2
> psql as well:
>
> $ /usr/pgsql-9.2/bin/psql
> 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"?
>
> $ /usr/pgsql-9.2/bin/psql --version
> psql (PostgreSQL) 9.2.22
>
> However I can connect if I specify "-h /tmp":
>
> $ /usr/pgsql-9.2/bin/psql -h /tmp
> psql (9.2.22)
> Type "help" for help.
>
> postgres=#
>
> Also when if I remove the 9.6 binaries (yum remove postgresql96*),
> then psql works as expected as well.
>
> I can sort of understand the socket thing from the 9.6 psql binary,
> but not the 9.2 binary. Either way it would break scripts for the
> existing DB, maybe some other backwards compatibility issues. Is
> there something else to change (other than unix_socket_directory,
> which would require a restart as well) so that installing the 9.6
> binaries wouldn't affect the 9.2 environment?
>
> --
> Don Seiler
> www.seiler.us
>
>

--
Jerry Sievers
Postgres DBA/Development Consulting
e: postgres(dot)consulting(at)comcast(dot)net
p: 312.241.7800

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Don Seiler 2017-10-04 20:36:56 Re: psql can't connect to old DB after installing new binaries
Previous Message Tom Lane 2017-10-04 20:03:40 Re: psql can't connect to old DB after installing new binaries