We can omit the (heavy on Pg) ->Fields call on 9.1 and above

Postgres 9.1 and higher can intuit the GROUP BY for all other columns if
just the primary key is listed[1], like MySQL does.  As ->Fields can be
a very heavyweight call (~5s, as DBD::Pg::column_info is slow), GROUP
purely by the id if possible.

[1] http://www.postgresql.org/docs/9.1/static/release-9-1.html#AEN109008
Only request column_info for the requested tables

Calling ->column_info( undef, '%', '%') requests column information for
all tables in all schemas; although this information is cached, it can
be extremely slow, especially when the Postgres server is not local.
Look up and cache the table information on a table-by-table basis,
instead of all at once, for considerale performance savings.

Note that the caching assumes that table names are case-sensitively
unique within a database.