On 05/27/2011 01:24 PM, Andre Majorel wrote:
While parsing the output of psql is cumbersome, accessing the
system tables seems more likely to break whenever a new version
of PostgreSQL comes out.

I think you have this backwards. If there's a change in this area big enough to justify changing the format of the system tables, odds are the text output from psql is going to be changed too. psql gets tweaked to display information better more often than the internals are altered.

Approaches you can take here, from most robust in the face of changes to most fragile, in my mind are:

1) Use information_schema. If all the info you need is in here, great; it may not be though.
2) Use the system catalog data directly
3) Parse text output from psql.

--
Greg Smith   2ndQuadrant US    g...@2ndquadrant.com   Baltimore, MD
PostgreSQL Training, Services, and 24x7 Support  www.2ndQuadrant.us
"PostgreSQL 9.0 High Performance": http://www.2ndQuadrant.com/books


--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Reply via email to