Re: Postgres v9.5.3 and v9.5.4 Unix Socket Issue

From: Murthy Nunna <mnunna(at)fnal(dot)gov>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "pgsql-admin(at)postgresql(dot)org" <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Postgres v9.5.3 and v9.5.4 Unix Socket Issue
Date: 2016-08-13 16:00:35
Message-ID: CY1PR09MB109952642F146AC92C2813A2B8100@CY1PR09MB1099.namprd09.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Hi Tom,

Following is output from "ldd" command:

ldd /fnal/ups/prd/postgres/v9_5_3_x64/Linux-2-6/bin/psql | grep -i libpq
libpq.so.5 => /fnal/ups/prd/postgres/v9_5_3_x64/Linux-2-6/lib/libpq.so.5 (0x00007fbce99f5000)

It doesn't look like we are using from Linux distribution as you suspected.

Murthy

-----Original Message-----
From: Tom Lane [mailto:tgl(at)sss(dot)pgh(dot)pa(dot)us]
Sent: Saturday, August 13, 2016 10:40 AM
To: Murthy Nunna <mnunna(at)fnal(dot)gov>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: [ADMIN] Postgres v9.5.3 and v9.5.4 Unix Socket Issue

Murthy Nunna <mnunna(at)fnal(dot)gov> writes:
> We downloaded and installed postgres from rpm(s). The installation is on Linux-x64.
> We did pg_upgrade of an existing 9.5.3 cluster.
> psql -U postgres -d template1 -p 5434
> 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.5434"?
> The socket is in /tmp and that is where it is supposed to be.

It looks to me like you have a copy of libpq that was built to think that the default socket location is in /var/run/postgresql not /tmp. That (or some close variant) is a change that many Linux packagers make because they worry that /tmp isn't secure enough. So what seems likely is that even if you are using the copy of psql that came from the PGDG RPMs (a fact you have not proven), it is linking to a libpq.so that came from your Linux distro vendor. "ldd" would help you track down which shared libraries psql is picking up, but I'll bet it's finding libpq.so in /usr/lib or /usr/lib64 rather than wherever the PGDG RPMs installed it.

There should be documentation material in the RPMs about how to get psql to find the right libpq. In the extreme you could set LD_LIBRARY_PATH all the time, but there may be an easier way. I've been out of the Linux-packaging game for a little while so I don't remember all the tricks.

Another alternative worth considering is to go ahead and make the server create a socket in /var/run/postgresql in addition to /tmp.

regards, tom lane

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Tom Lane 2016-08-13 16:11:56 Re: Postgres v9.5.3 and v9.5.4 Unix Socket Issue
Previous Message Murthy Nunna 2016-08-13 15:54:07 Re: Postgres v9.5.3 and v9.5.4 Unix Socket Issue