pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pf@pfortin.com
Cc: pgsql-general@lists.postgresql.org, Amn Ojee Uw <amnojeeuw@gmail.com>
Subject: Re: error: connection to server on socket...
Date: Tue, 01 Aug 2023 09:10:57 -0400
Message-ID: <3069605.1690895457@sss.pgh.pa.us> (raw)
In-Reply-To: <20230801072849.2faa25f1.pfortin@pfortin.com>
References: <97d77785-22a0-5d48-9582-4a7beb2dc14f@gmail.com>
	<20230801072849.2faa25f1.pfortin@pfortin.com>

pf@pfortin.com writes:
> On Tue, 1 Aug 2023 06:22:46 -0400 Amn Ojee Uw wrote:
>> "/var/run/postgresql/.s.PGSQL.5432" failed: No such file or directory*//*

> Like mine, your distro probably uses /tmp/.s.PGSQL.5432 
> $ ll /tmp/.s.PGSQL.5432
> srwxrwxrwx 1 postgres postgres 0 Aug  1 06:33 /tmp/.s.PGSQL.5432=

Yeah.  Look to see if there's a socket file there, and if so try

sudo -u postgres psql -h /tmp

In the longer term, this indicates that you have a psql that did
not come from the same packager as your server, because the server
thinks the default socket location is /tmp, but psql (or really
the libpq.so it's using) thinks the default location is
/var/run/postgresql.  That's a build-time choice that some
packagers make because $standards.  So the long-term fix is to
not have a hodge-podge of different Postgres installations on
the same machine.

BTW, you can ignore the "could not change directory" warning.
That's expected when starting "sudo -u postgres psql" in a
directory that the postgres user can't read.

			regards, tom lane





view thread (10+ messages)  latest in thread

Message-ID: <3069605.1690895457@sss.pgh.pa.us>
Permalink:  ../3069605.1690895457@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/3069605.1690895457@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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: tgl@sss.pgh.pa.us, pf@pfortin.com, amnojeeuw@gmail.com
  Subject: Re: error: connection to server on socket...
  In-Reply-To: <3069605.1690895457@sss.pgh.pa.us>
  References: <97d77785-22a0-5d48-9582-4a7beb2dc14f@gmail.com> <20230801072849.2faa25f1.pfortin@pfortin.com> <3069605.1690895457@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