Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r5s5Q-00FaAR-Mi for pgsql-general@arkaria.postgresql.org; Wed, 22 Nov 2023 18:36:33 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1r5s5O-00BrYH-FI for pgsql-general@arkaria.postgresql.org; Wed, 22 Nov 2023 18:36:30 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r5s5N-00BrY9-7i for pgsql-general@lists.postgresql.org; Wed, 22 Nov 2023 18:36:30 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r5s5K-006qiI-JB for pgsql-general@lists.postgresql.org; Wed, 22 Nov 2023 18:36:27 +0000 Received: from compute7.internal (compute7.nyi.internal [10.202.2.48]) by mailout.nyi.internal (Postfix) with ESMTP id B1A865C023D; Wed, 22 Nov 2023 13:36:25 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute7.internal (MEProxy); Wed, 22 Nov 2023 13:36:25 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm3; t=1700678185; x=1700764585; bh=ZY JtMukg1NyRohUnfaoIqr/tI+fEnRsVUJX/1+W4lqY=; b=lbbo7Ad6NChZPbsbyF SVXZNyYa0b3hyuM0AUsfi1yN/MIOonhgb2svvFRrtjMQdy1KrObHKTXh1hkAqxc8 fbwtPuDGyjZkAEy6SFpUS2o5eswyU8cuLwa8sxcRSzHk12TjCI43hETrq4PF/5mA rYqKiAKaDrFIrcTo17wOjuVI1rJR7Jt8BtZbDuRyCgJn1wdPpq023h5qM/GrOMBX qtfv7o1nlZ1q3hiIJqpLGcxdwKfwNb5XWGbau1GkRGC2OiRfT6Wy85ZaSR5PBzyB eIjJDvdo8k4/MR9Pu8mLuCQyAWRfM/ULMFrFjc5Phaj26xPoS3xrAIwKrhdalh1h 6D1Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; t=1700678185; x=1700764585; bh=ZYJtMukg1NyRo hUnfaoIqr/tI+fEnRsVUJX/1+W4lqY=; b=P4KJM2m+afM8kn848OzgY+gIq+vc3 6q4FAQZ9rmllrVYO41baqpoLqQqb9A4Cp5pVHujaHtEZT4xrfZd8WZV5+T55g9Yq wagPSnaQQq8m3Ns6ZylkwlLjRlpzGF3G0sVT7JAQSoSWwDNIjq5y2yz7C4eCIQFj SaEcwk0Lvz5BRKGxmska8iSanaCzjzWGX0+/wtXcmPfCrdBwwN34S4qca3AIiCzd kyDgmpv8H9MHH6kLSqrwm+cP2POGFDiTjFXtheg82QDWAEzwPAjKRYAmQhbiA1Mk 0E1irmfMA98CYoBBrGtUtKwrFmWq4438DJLpWWcfgKem+P7AtFmEWkIKw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrudehuddgudduvdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpegtkfffgggfuffhvfhfjgesrgdtreertddvjeenucfhrhhomheptegurhhi rghnucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtoh hmqeenucggtffrrghtthgvrhhnpeffhffhgeduhfeuveejjeejueefgefhkeffheelteev teffgeevkeejueehfefgieenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmh grihhlfhhrohhmpegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtohhm X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 22 Nov 2023 13:36:24 -0500 (EST) Content-Type: multipart/alternative; boundary="------------Dyi3D2y6AQ7nIRcLfRlAlYq4" Message-ID: Date: Wed, 22 Nov 2023 10:36:22 -0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: strange behavior of pg_hba.conf file Content-Language: en-US From: Adrian Klaver To: Andreas Kretschmer , pgsql-general@lists.postgresql.org References: <8758be84-0309-6ead-4d66-4d86a719f333@a-kretschmer.de> <17bd5946-12d5-4907-baa9-dee368d34214@aklaver.com> In-Reply-To: <17bd5946-12d5-4907-baa9-dee368d34214@aklaver.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------Dyi3D2y6AQ7nIRcLfRlAlYq4 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 11/22/23 10:01 AM, Adrian Klaver wrote: > > > On 11/22/23 9:55 AM, Andreas Kretschmer wrote: >> >> >> Am 22.11.23 um 18:44 schrieb Atul Kumar: >>> I am giving this command >>> psql -d postgres -U postgres -p 5432 -h localhost >>> Then only I get that error. >> >> so localhost resolved to an IPv6 - address ... > > > Yeah, you should take a look at: > > /etc/hosts > > > In meantime include a  line for IPv6 in pg_hba.conf. where the address > would be: > > ::1/128 Or you could change host all postgres 127.0.0.1/32 scram-sha-256 to host all postgres localhost scram-sha-256 > > --------------Dyi3D2y6AQ7nIRcLfRlAlYq4 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit


On 11/22/23 10:01 AM, Adrian Klaver wrote:


On 11/22/23 9:55 AM, Andreas Kretschmer wrote:


Am 22.11.23 um 18:44 schrieb Atul Kumar:
I am giving this command
psql -d postgres -U postgres -p 5432 -h localhost
Then only I get that error.

so localhost resolved to an IPv6 - address ...


Yeah, you should take a look at:

/etc/hosts


In meantime include a  line for IPv6 in pg_hba.conf. where the address would be:

::1/128 

Or you could change


host all postgres 127.0.0.1/32 scram-sha-256


to


host all postgres localhost scram-sha-256



--------------Dyi3D2y6AQ7nIRcLfRlAlYq4--