But according to pg_hba.conf I am not connecting using ident on localhost:
host all all 127.0.0.1/32 md5
or am I?
host all all ::1/128 ident
Because you know, ::1 is localhost also and you can easily overlook this. Never forget IPv6 even when dealing with localhost.
Actually, on RHEL family distros only 127.0.0.1 is localhost by default. ::1 is localhost6.
But this has backfired on me too, some milter expected that localhost would get it to connect to ::1, but it didn’t (ref).
Interesting, since this happened to me today on a CentOS 6.6.