Re: IPV6 issue

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: Atul Kumar <akumar14871(at)gmail(dot)com>, pgsql-general <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: IPV6 issue
Date: 2023-11-23 20:43:02
Message-ID: efaad723-8d08-4640-a5d2-d8b91f20cb39@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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(dot)klaver(at)aklaver(dot)com

In response to

  • IPV6 issue at 2023-11-23 19:18:25 from Atul Kumar

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2023-11-24 05:21:18 Re: Inquiry Regarding Initial Seed for pgsql Protocol Fuzz Testing
Previous Message Tom Lane 2023-11-23 19:45:23 Re: Odd Shortcut behaviour in PG14