opscode-cookbooks/postgresql — pull request #68 by ablanco (2013-08-07 08:18:01+00:00)
Title: Give the user's rules more priority than the default ones in pg_hba

The priority of the `pg_hba` entries is defined by their position in the file. The sooner they appear, the more priority it has.

The default `local` entry that uses the `ident` auth method has more priority than the node rules, because it appears before. This is problematic because the rule is pretty generic, it applies to all users and all databases. That means the user can't define a more specific rule, for example:

local database username md5

A rule like this would give access by socket to a `username` user to the `database` db using a password. But it won't work since the `ident` default rule appears before in the file.

This pull request changes that, putting the user's rules before the default ones.