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

From David Hillman
Subject Re: BUG #17249: Bug in .pgpass search and/or documentation thereof, Ubuntu 13.4-4
Date
Msg-id e06bb190-7afb-9002-2333-ff3b8ef4e153@kapitaltrading.com
Whole thread Raw
In response to Re: BUG #17249: Bug in .pgpass search and/or documentation thereof, Ubuntu 13.4-4  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: BUG #17249: Bug in .pgpass search and/or documentation thereof, Ubuntu 13.4-4  ("David G. Johnston" <david.g.johnston@gmail.com>)
List pgsql-bugs
On 10/27/21 7:17 PM, Tom Lane wrote:

> 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").

This is still a bug, since per your description, the -U flag doesn't 
work correctly -- or is meaningless.  And, the -U flag works differently 
depending on which other flags are set ( -h in his case ), as my example 
does show, and that's not documented anywhere, as far as I know.


> 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.

There exist no such lines which pertain to "valid_user" here.

Furthermore, if I remove .pgpass, this case's result changes.

root@dbserver:~# cat ~/.pgpass
cat: /root/.pgpass: No such file or directory
root@dbserver:~# psql -d postgres -U valid_user -h localhost
Password for user valid_user:

Clearly, .pgpass is being utilized in the second example, and not in the 
first, contrary to the apparent intent and the documentation.

-- 
David Hillman
david@kapitaltrading.com




pgsql-bugs by date:

Previous
From: Noah Misch
Date:
Subject: Re: CREATE INDEX CONCURRENTLY does not index prepared xact's data
Next
From: Tom Lane
Date:
Subject: Re: conchuela timeouts since 2021-10-09 system upgrade