puppetlabs/puppetdb — pull request #310 by nicklewis (2012-10-04 18:14:11+00:00)
Title: Be explicit about allowed columns in resource metadata queries

This was previously looking for any string, checking that it was a
reasonable column name, and then trying it. In the case where it wasn't
a real column, a PSQLException was raised, which is an unhelpful,
embarrassing error that reveals too much of the implementation.

Now we check for exactly the set of columns on the catalog_resources
table, and fail helpfully in any other case.