This seems stupid simple but it's not working.
My pg_hba.conf
:
# type database user address type
local all postgres peer # postgres user
local all fred peer # fred should be able to get in w/o password
host all all 127.0.0.1/32 peer # ipv6 local connections
host all all ::1/128 peer # ipv4 local
host all all 0.0.0.0/0 md5 # authenticated from any host
Now, good old fred
can connect find when just doing psql freddb
, but when fred
tries psql -h localhost freddb
it prompts for a password, which I feel like it shouldn't by virtue of the third line in pg_hba
. What gives, friends? Help old fred
out here.
peer
forhost
connections, it's unix-socket only. postgresql.org/docs/current/static/auth-methods.html#AUTH-PEER