Inspecting a DB - psql or system tables ?

From: Andre Majorel <aym-2lqsgp(at)teaser(dot)fr>
To: pgsql-general(at)postgresql(dot)org
Subject: Inspecting a DB - psql or system tables ?
Date: 2011-05-27 17:24:56
Message-ID: 20110527172456.GC6769@aym.net2.nerim.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Suppose you want to write a program that connects to a
PostgreSQL database and lists its tables and views, the type of
their columns and their relationships (REFERENCES) for automatic
joins.

Would you look at the system tables (pg_class et al.) or the
output of psql \d, \dt, etc ?

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.

--
André Majorel http://www.teaser.fr/~amajorel/

Responses

Browse pgsql-general by date

  From Date Subject
Next Message fork 2011-05-27 17:57:08 Re: Inspecting a DB - psql or system tables ?
Previous Message Carlos Sotto Maior (SIM) 2011-05-27 16:41:36 SELECT COUNT(*) execution time on large tables (v9.0.4-1)