Re: postgresql unix socket connections - Mailing list pgsql-performance

From Jeff Janes
Subject Re: postgresql unix socket connections
Date
Msg-id CAMkU=1ysUhYcRcDDUxTadt5vPVhg5UydafKTsT9SYjE2igRdQQ@mail.gmail.com
Whole thread Raw
In response to postgresql unix socket connections  (Mariel Cherkassky <mariel.cherkassky@gmail.com>)
List pgsql-performance
On Wed, Jan 9, 2019 at 3:35 AM Mariel Cherkassky <mariel.cherkassky@gmail.com> wrote:

Now, In machine 1 when I run psql I get the prompt password but in machine 2 I keep getting the next error : 

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

One important thing that I didnt mention, is that I installed in machine 2 package postgresql-libs.x86_64 0:8.4.20-8.el6_9 from the postgres repository (in order to upgrade it to 9.6).

The front end and the backend have compiled-in defaults for the socket directory.  If you installed them from different sources, they may have different compiled-in defaults.  Which means they may not be able to rendezvous using the default settings for both of them.  

You can override the default using unix_socket_directory on the server (as you discovered).  On the client you can override it by using -h (or PGHOST or host= or whatever mechanism), with an argument that looks like a directory, starting with a '/'.

Cheers,

Jeff

pgsql-performance by date:

Previous
From: Mariel Cherkassky
Date:
Subject: Re: postgresql unix socket connections
Next
From: Jeff Janes
Date:
Subject: Re: postgresql unix socket connections