From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Ron Johnson <ronljohnsonjr@gmail.com>
Cc: Atul Kumar <akumar14871@gmail.com>
Cc: pgsql-general <pgsql-general@lists.postgresql.org>
Subject: Re: permission denied on socket
Date: Thu, 25 Jan 2024 13:14:58 -0800
Message-ID: <c935ec0f-2a91-436e-a5a1-66728705461d@aklaver.com> (raw)
In-Reply-To: <CANzqJaBE9dRWqghXctFn5C0j_oYBBH53sEUQKt-4cAP_KTSniw@mail.gmail.com>
References: <CA+ONtZ5Rmk4=EvXd0j17iN6O0WUhJDmEfK=WJavMsw5ygizfng@mail.gmail.com>
<e7811f7a-ef88-43e9-917f-9cf005e8202f@aklaver.com>
<CANzqJaBE9dRWqghXctFn5C0j_oYBBH53sEUQKt-4cAP_KTSniw@mail.gmail.com>
On 1/25/24 12:39 PM, Ron Johnson wrote:
> On Thu, Jan 25, 2024 at 3:32 PM Adrian Klaver
> <adrian.klaver@aklaver.com> wrote:
> [snip]
>
> Best guess is you are using a version of psql that is expecting the
> socket to be somewhere else then where it actually is.
>
>
> Is "permission denied" really the error you get when the socket does
> not exist?
>
> Trying "psql --host=/var/run/foo" gave me "No such file or directory".
The OP used:
psql postgres
In that case psql will use the default set when it is compiled against
libpq which from here:
https://www.postgresql.org/docs/16/libpq-connect.html#LIBPQ-PARAMKEYWORDS
"... is to connect to a Unix-domain socket in |/tmp| (or whatever socket
directory was specified when PostgreSQL was built)"
If you have more then one instance of psql on a machine and they where
built with different defaults you can
end up not hitting the right socket.
Also "permission denied" could be due to any part of the path
/tmp/.s.PGSQL.5432.
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: adrian.klaver@aklaver.com, ronljohnsonjr@gmail.com, akumar14871@gmail.com
Subject: Re: permission denied on socket
In-Reply-To: <c935ec0f-2a91-436e-a5a1-66728705461d@aklaver.com>
References: <CA+ONtZ5Rmk4=EvXd0j17iN6O0WUhJDmEfK=WJavMsw5ygizfng@mail.gmail.com> <e7811f7a-ef88-43e9-917f-9cf005e8202f@aklaver.com> <CANzqJaBE9dRWqghXctFn5C0j_oYBBH53sEUQKt-4cAP_KTSniw@mail.gmail.com> <c935ec0f-2a91-436e-a5a1-66728705461d@aklaver.com>
* 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