On Fedora 12, I'm setting up a test database for myself, and pg_hba.conf contains the following by default:
# TYPE DATABASE USER CIDR-ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all ident
# IPv4 local connections:
host all all 127.0.0.1/32 ident
# IPv6 local connections:
host all all ::1/128 ident
I want to enable md5 logins so the PostgreSQL user named 'foo' can access the database named 'foo'. However, when I add this line and restart postgres:
local foo foo md5
Running psql -U 'foo' with my regular user account still yields the message:
psql: FATAL: Ident authentication failed for user "foo"
I have to remove the first local line (which has ident) before I can log in via md5 to 'foo'.
How can I enable md5 authentication for 'foo' while keeping ident authentication like I already have?