I commented in the wrong place, pasting them here.

This doesn't work because by default (using system packages, `postgresql-devel` for CentOS and `postgresql-common` on Ubuntu) `/usr/bin/pg_config` is the real file. `"/usr/pgsql-#{node[:postgresql][:version]}/bin/pg_config"` is only used by [packages provided by PostgreSQL](http://yum.postgresql.org/).

I think one way to accommodate this is to only use http://yum.postgresql.org/ when the version specified is different from the version provided by the distro. Note that http://yum.postgresql.org/ doesn't work for Ubuntu (which is not needed yet).