Skip to main content
1 of 3
András Váczi
  • 31.6k
  • 13
  • 101
  • 149

In a fresh install from a few days ago, the second line of my pg_hba.conf is

local   all             all              peer

The order of rules matter here: the first one that matches the access method, username, database name and source IP range will be considered. If it fails, then there is no second try, so the connection attempt will likely fail. Or, as the documentation states:

There is no "fall-through" or "backup": if one record is chosen and the authentication fails, subsequent records are not considered. If no record matches, access is denied.

The solution is easy: either remove the above line if you don't plan to use peer authentication, or move your specific rule above this one.

András Váczi
  • 31.6k
  • 13
  • 101
  • 149