On Tuesday, September 10, 2024, Chris Miller <
cjm@tryx.org> wrote:
Hi Folks,
I am confused about authentication. I understand that in the local connection case, I have choices of “peer”, and “md5” (password).
In pg_hba.conf, I have the lines:
local all all peer
local all all md5
The second line is pointless, the first three columns are compared against the incoming connection host/user/dbname to find out how authentication should be handled. The first match wins. So for every local connection peer, and only peer, is going to be used since everything matches all/all.
There is no way to give a user a choice of how to authenticate. There will be one accepted option for a given set of connection values.
David J.