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 1mft7T-0001a0-5y for pgsql-bugs@arkaria.postgresql.org; Thu, 28 Oct 2021 00:18:11 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mft7R-0003GJ-TZ for pgsql-bugs@arkaria.postgresql.org; Thu, 28 Oct 2021 00:18:09 +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 1mft7R-0003G9-M2 for pgsql-bugs@lists.postgresql.org; Thu, 28 Oct 2021 00:18:09 +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 1mft7J-00006p-RC for pgsql-bugs@lists.postgresql.org; Thu, 28 Oct 2021 00:18:09 +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 19S0Hwkb287306; Wed, 27 Oct 2021 20:17:58 -0400 From: Tom Lane To: david@kapitaltrading.com cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #17249: Bug in .pgpass search and/or documentation thereof, Ubuntu 13.4-4 In-reply-to: <17249-c2fa2b1085dfb2f7@postgresql.org> References: <17249-c2fa2b1085dfb2f7@postgresql.org> Comments: In-reply-to PG Bug reporting form message dated "Wed, 27 Oct 2021 23:11:12 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <287304.1635380278.1@sss.pgh.pa.us> Date: Wed, 27 Oct 2021 20:17:58 -0400 Message-ID: <287305.1635380278@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk PG Bug reporting form writes: > There's a bug in either the .pgpass search, or the documentation thereof, in > 13.4-4. Perhaps, but this example doesn't prove it. Your failing case is > root@dbserver:~# psql -d postgres -U valid_user > psql: error: connection to server on socket > "/var/run/postgresql/.s.PGSQL.5432" failed: FATAL: Peer authentication > failed for user "valid_user" Notice it says "peer authentication", not "password authentication". So the password was never asked for, and the problem is that you're not logged in as "valid_user" (rather, it looks like, as "root"). > root@dbserver:~# psql -d postgres -U valid_user -h localhost > psql (13.4 (Ubuntu 13.4-4.pgdg20.04+1)) > SSL connection (protocol: TLSv1.3, cipher: TLS_AES_256_GCM_SHA384, bits: > 256, compression: off) This is evidently going to a different pg_hba.conf line, which might or might not be selecting password auth --- we can't see it. regards, tom lane