pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Mariel Cherkassky <mariel.cherkassky@gmail.com>
Cc: pgsql-performance@lists.postgresql.org
Subject: Re: postgresql unix socket connections
Date: Wed, 09 Jan 2019 09:55:02 -0500
Message-ID: <19153.1547045702@sss.pgh.pa.us> (raw)
In-Reply-To: <CA+t6e1kUQj+ZGPZZPjW7Fbg=69UaLj-cRgSGZiWFk+bR=-H5+w@mail.gmail.com>
References: <CA+t6e1kUQj+ZGPZZPjW7Fbg=69UaLj-cRgSGZiWFk+bR=-H5+w@mail.gmail.com>

Mariel Cherkassky <mariel.cherkassky@gmail.com> writes:
> I'm trying to understand some issues that I'm having with the unix_socket
> settings and pgsql.
> I have 2 machines with pg v9.2.5 with the same next settings :
> #listen_addresses = 'localhost'
> #unix_socket_directory = ''

This will result in the server creating the socket in whatever it thinks
is the default socket directory.  Traditionally PG uses /tmp as the
default socket directory, and your netstat result is consistent with that:

> unix  2      [ ACC ]     STREAM     LISTENING     51587140 3729/postgres
>    /tmp/.s.PGSQL.5432

However, this:

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

shows that your psql is using a libpq that thinks the default socket
directory is /var/run/postgresql.  That's a build-time option, and
I recall that Red Hat builds their postgresql package that way.
I'm not 100% sure which way the PGDG RPMs do it.

You could override libpq's default, for instance via "psql -h /tmp".
But probably you'd be better off removing any packages that provide
libpq versions that don't match your server.

Alternatively, you could configure the server to create socket
files in both places.

			regards, tom lane




view thread (11+ messages)  latest in thread

Message-ID: <19153.1547045702@sss.pgh.pa.us>
Permalink:  ../19153.1547045702@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/19153.1547045702@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: tgl@sss.pgh.pa.us, mariel.cherkassky@gmail.com, pgsql-performance@lists.postgresql.org
  Subject: Re: postgresql unix socket connections
  In-Reply-To: <19153.1547045702@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox