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

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: BUG #17249: Bug in .pgpass search and/or documentation thereof, Ubuntu 13.4-4
Дата
Msg-id CAKFQuwb-_1FgMLRFWGXb1WHrkwKMmdtKMWxLDYosuudkbcB70g@mail.gmail.com
обсуждение исходный текст
Ответ на Re: BUG #17249: Bug in .pgpass search and/or documentation thereof, Ubuntu 13.4-4  (David Hillman <david@kapitaltrading.com>)
Ответы Re: BUG #17249: Bug in .pgpass search and/or documentation thereof, Ubuntu 13.4-4  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
On Thu, Oct 28, 2021 at 8:54 AM David Hillman <david@kapitaltrading.com> wrote:

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:


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.

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Peter Geoghegan
Дата:
Сообщение: Re: BUG #17245: Index corruption involving deduplicated entries
Следующее
От: Tom Lane
Дата:
Сообщение: Re: BUG #17249: Bug in .pgpass search and/or documentation thereof, Ubuntu 13.4-4