Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mg85u-0008Uf-8k for pgsql-bugs@arkaria.postgresql.org; Thu, 28 Oct 2021 16:17:34 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mg85t-0000Xz-4F for pgsql-bugs@arkaria.postgresql.org; Thu, 28 Oct 2021 16:17:33 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mg85s-0000W0-Sx for pgsql-bugs@lists.postgresql.org; Thu, 28 Oct 2021 16:17:32 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mg85q-0008Rm-Kk for pgsql-bugs@lists.postgresql.org; Thu, 28 Oct 2021 16:17:32 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 19SGHR8n488036; Thu, 28 Oct 2021 12:17:27 -0400 From: Tom Lane To: "David G. Johnston" cc: David Hillman , PostgreSQL mailing lists Subject: Re: BUG #17249: Bug in .pgpass search and/or documentation thereof, Ubuntu 13.4-4 In-reply-to: References: <17249-c2fa2b1085dfb2f7@postgresql.org> <287305.1635380278@sss.pgh.pa.us> Comments: In-reply-to "David G. Johnston" message dated "Thu, 28 Oct 2021 09:06:45 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <488034.1635437847.1@sss.pgh.pa.us> Date: Thu, 28 Oct 2021 12:17:27 -0400 Message-ID: <488035.1635437847@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk "David G. Johnston" writes: > Your original email demonstrates that, absent -h localhost, psql is looking > for and finding a local socket and thus the first matching entry is a > "local" one which does not require password entry because it is set for > "peer". This is working as intended. Indeed. If you don't like the results you're getting, you need to go adjust your pg_hba.conf file. Right now, you've got it set to apply different authentication rules for Unix-socket and localhost connections, and you apparently don't want that. regards, tom lane