Re: Postgres v9.5.3 and v9.5.4 Unix Socket Issue - Mailing list pgsql-admin

From Murthy Nunna
Subject Re: Postgres v9.5.3 and v9.5.4 Unix Socket Issue
Date
Msg-id CY1PR09MB109952642F146AC92C2813A2B8100@CY1PR09MB1099.namprd09.prod.outlook.com
Whole thread Raw
In response to Re: Postgres v9.5.3 and v9.5.4 Unix Socket Issue  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Postgres v9.5.3 and v9.5.4 Unix Socket Issue  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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@sss.pgh.pa.us]
Sent: Saturday, August 13, 2016 10:40 AM
To: Murthy Nunna <mnunna@fnal.gov>
Cc: pgsql-admin@postgresql.org
Subject: Re: [ADMIN] Postgres v9.5.3 and v9.5.4 Unix Socket Issue

Murthy Nunna <mnunna@fnal.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/postgresqlnot /tmp.  That (or some close variant) is a change that many Linux packagers make because they
worrythat /tmp isn't secure enough.  So what seems likely is that even if you are using the copy of psql that came from
thePGDG RPMs (a fact you have not proven), it is linking to a libpq.so that came from your Linux distro vendor.  "ldd"
wouldhelp you track down which shared libraries psql is picking up, but I'll bet it's finding libpq.so in /usr/lib or
/usr/lib64rather 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
couldset LD_LIBRARY_PATH all the time, but there may be an easier way.  I've been out of the Linux-packaging game for a
littlewhile 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
additionto /tmp. 

            regards, tom lane


pgsql-admin by date:

Previous
From: Murthy Nunna
Date:
Subject: Re: Postgres v9.5.3 and v9.5.4 Unix Socket Issue
Next
From: Tom Lane
Date:
Subject: Re: Postgres v9.5.3 and v9.5.4 Unix Socket Issue