pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Atul Kumar <akumar14871@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Ron Johnson <ronljohnsonjr@gmail.com>
Cc: pgsql-general <pgsql-general@lists.postgresql.org>
Subject: Re: IPV6 issue
Date: Mon, 27 Nov 2023 17:14:01 -0800
Message-ID: <4a78e9e9-5d7f-4e7a-b3f4-0708161c1a1c@aklaver.com> (raw)
In-Reply-To: <CA+ONtZ50DtdMP2NgS7jBwq4hZUUUJ9KereYs2FKo_vZwnPONcQ@mail.gmail.com>
References: <CA+ONtZ62uKURz1SLZqhJ1pwwFJB0BRXzPRN1zdAX3xo0Vo-JFQ@mail.gmail.com>
	<CANzqJaAV7Tyahwrms=iRLR-_A1uMHgwWjMHMhpMYLgiyNT8iGQ@mail.gmail.com>
	<CA+ONtZ7hGMKZDZHg4SVecZ3+mkPDwcey-P8wr7PTJSsrJ_e0eA@mail.gmail.com>
	<d6cdfb91-caf2-4f98-9d82-5019f5262ff5@aklaver.com>
	<4007721.1701117710@sss.pgh.pa.us>
	<CA+ONtZ7rWWSzk3LEXiNEgMaqo048PjdPe03QjHForzD=+R5rng@mail.gmail.com>
	<11f1c399-34f6-4b2a-8869-2f5db9c59b89@aklaver.com>
	<CA+ONtZ50DtdMP2NgS7jBwq4hZUUUJ9KereYs2FKo_vZwnPONcQ@mail.gmail.com>

On 11/27/23 16:58, Atul Kumar wrote:
> I Don't know how postgres was installed,

1) Someone installed it. Ask around on where it came from.

2) Query the package manager to see if it was installed that way?


> 
> How do I check if I have more than one version of psql installed ?

A quick and dirty way to see what you are using:

    whereis psql

To find all the versions:

    sudo find / -name  psql

> 
> 
> Regards.
> 
> On Tue, Nov 28, 2023 at 6:26 AM Adrian Klaver <adrian.klaver@aklaver.com 
> <mailto:adrian.klaver@aklaver.com>> wrote:
> 
>     On 11/27/23 16:42, Atul Kumar wrote:
>      > Hi,
>      >
>      > unix_socket_directories is set to default i.e. /tmp and I could
>     see the
>      > socket in /tmp directory.
> 
>     You have not answered:
> 
>          How did you install Postgres?
> 
>          Do you have more then one version of psql installed?
> 
> 
>     Though I am pretty sure I know the answer to the second question.
> 
> 
>      >
>      >
>      > Regards.
>      >
>      >
>      >
>      >
>      > On Tue, Nov 28, 2023 at 2:11 AM Tom Lane <tgl@sss.pgh.pa.us
>     <mailto:tgl@sss.pgh.pa.us>
>      > <mailto:tgl@sss.pgh.pa.us <mailto:tgl@sss.pgh.pa.us>>> wrote:
>      >
>      >     Adrian Klaver <adrian.klaver@aklaver.com
>     <mailto:adrian.klaver@aklaver.com>
>      >     <mailto:adrian.klaver@aklaver.com
>     <mailto:adrian.klaver@aklaver.com>>> writes:
>      >      > On 11/27/23 12:11, Atul Kumar wrote:
>      >      >> I found that localhost was set to .bash_profile and when I
>      >     removed it
>      >      >> and then re-attempted to connected the database using "psql
>      >     postgres", I
>      >      >> got this new error:
>      >      >>
>      >      >> psql postgres -p 5432
>      >      >> psql: error: 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"?
>      >
>      >      > Do you have more then one version of psql installed?
>      >
>      >     Yeah, that.  You're apparently using a version of psql/libpq that
>      >     thinks the default Unix socket location is /var/run/postgresql;
>      >     but the postmaster you are using did not create a socket there.
>      >     (Probably it put one in /tmp instead, which is the out-of-the-box
>      >     default location.  But some distros consider that insecure so
>     they
>      >     override it, typically to /var/run/postgresql/.)
>      >
>      >     The easiest workaround if you have a mishmash of Postgres
>     libraries
>      >     is to tell the postmaster to create sockets in both places.
>      >     See "unix_socket_directories" parameter.
>      >
>      >                              regards, tom lane
>      >
> 
>     -- 
>     Adrian Klaver
>     adrian.klaver@aklaver.com <mailto:adrian.klaver@aklaver.com>
> 

-- 
Adrian Klaver
adrian.klaver@aklaver.com






view thread (11+ messages)

Message-ID: <4a78e9e9-5d7f-4e7a-b3f4-0708161c1a1c@aklaver.com>
Permalink:  ../4a78e9e9-5d7f-4e7a-b3f4-0708161c1a1c@aklaver.com/
Also on:    postgresql.org/message-id/4a78e9e9-5d7f-4e7a-b3f4-0708161c1a1c@aklaver.com

 · 

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: adrian.klaver@aklaver.com, akumar14871@gmail.com, tgl@sss.pgh.pa.us, ronljohnsonjr@gmail.com
  Subject: Re: IPV6 issue
  In-Reply-To: <4a78e9e9-5d7f-4e7a-b3f4-0708161c1a1c@aklaver.com>
  References: <CA+ONtZ62uKURz1SLZqhJ1pwwFJB0BRXzPRN1zdAX3xo0Vo-JFQ@mail.gmail.com> <CANzqJaAV7Tyahwrms=iRLR-_A1uMHgwWjMHMhpMYLgiyNT8iGQ@mail.gmail.com> <CA+ONtZ7hGMKZDZHg4SVecZ3+mkPDwcey-P8wr7PTJSsrJ_e0eA@mail.gmail.com> <d6cdfb91-caf2-4f98-9d82-5019f5262ff5@aklaver.com> <4007721.1701117710@sss.pgh.pa.us> <CA+ONtZ7rWWSzk3LEXiNEgMaqo048PjdPe03QjHForzD=+R5rng@mail.gmail.com> <11f1c399-34f6-4b2a-8869-2f5db9c59b89@aklaver.com> <CA+ONtZ50DtdMP2NgS7jBwq4hZUUUJ9KereYs2FKo_vZwnPONcQ@mail.gmail.com> <4a78e9e9-5d7f-4e7a-b3f4-0708161c1a1c@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