Re: BUG #17249: Bug in .pgpass search and/or documentation thereof, Ubuntu 13.4-4

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: David Hillman <david(at)kapitaltrading(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL mailing lists <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: BUG #17249: Bug in .pgpass search and/or documentation thereof, Ubuntu 13.4-4
Date: 2021-10-28 16:06:45
Message-ID: CAKFQuwb-_1FgMLRFWGXb1WHrkwKMmdtKMWxLDYosuudkbcB70g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Thu, Oct 28, 2021 at 8:54 AM David Hillman <david(at)kapitaltrading(dot)com>
wrote:

>
> Furthermore, if I remove .pgpass, this case's result changes.
>
> root(at)dbserver:~# cat ~/.pgpass
> cat: /root/.pgpass: No such file or directory
> root(at)dbserver:~# psql -d postgres -U valid_user -h localhost
> Password for user valid_user:
>
>
You've already demonstrated that when connecting via "host" the first
matching entry is a password requiring entry. In your first email pgpass
provided the password. Here you've simply removed pgpass and demonstrated
that you are actually being prompted for the password, as expected.

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. psql decides first where to go talk,
then the pg_hba.conf file ignores any irrelevant lines based upon where the
connection is coming in from and picks the first match among the remaining.

David J.

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2021-10-28 16:17:27 Re: BUG #17249: Bug in .pgpass search and/or documentation thereof, Ubuntu 13.4-4
Previous Message Peter Geoghegan 2021-10-28 15:53:26 Re: BUG #17245: Index corruption involving deduplicated entries