From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Atul Kumar <akumar14871@gmail.com>
To: pgsql-general <pgsql-general@lists.postgresql.org>
Subject: Re: IPV6 issue
Date: Thu, 23 Nov 2023 12:43:02 -0800
Message-ID: <efaad723-8d08-4640-a5d2-d8b91f20cb39@aklaver.com> (raw)
In-Reply-To: <CA+ONtZ62uKURz1SLZqhJ1pwwFJB0BRXzPRN1zdAX3xo0Vo-JFQ@mail.gmail.com>
References: <CA+ONtZ62uKURz1SLZqhJ1pwwFJB0BRXzPRN1zdAX3xo0Vo-JFQ@mail.gmail.com>
On 11/23/23 11:18, Atul Kumar wrote:
> I have postgres 12 running in centos 7 on my two machines, recently I
> changed the authentication of entries of pg_hba.conf to
> scram-sha-256 for localhost.
>
> Since then in my one machine, I have started getting the below error
> when I use command "psql postgres"
>
> no pg_hba.conf entry for host "::1", user "postgres", database "postgres
>
>
> I found that localhost is resolve to IPV6 by using below command:
>
> getent hosts localhost
>
> ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
I don't think this is telling you the whole story.
See what is in
/etc/hosts
and in
/etc/nsswitch.conf
on each machine.
> host all postgres 127.0.0.1/32
> <http://127.0.0.1/32> scram-sha-256
>
>
> I am not able to understand that my both machines are resolved to IPV6
> then why is my first machine is throwing this error ?
Change this 127.0.0.1/32 to localhost and then be covered for both
situations.
>
>
> Please help.
>
>
>
>
> Regards.
>
--
Adrian Klaver
adrian.klaver@aklaver.com
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
Subject: Re: IPV6 issue
In-Reply-To: <efaad723-8d08-4640-a5d2-d8b91f20cb39@aklaver.com>
References: <CA+ONtZ62uKURz1SLZqhJ1pwwFJB0BRXzPRN1zdAX3xo0Vo-JFQ@mail.gmail.com> <efaad723-8d08-4640-a5d2-d8b91f20cb39@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