libpq: possible to get list of tables, fields, and types?

From: john heasley <heas(at)shrubbery(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: libpq: possible to get list of tables, fields, and types?
Date: 2001-12-29 21:28:15
Message-ID: 20011229132815.I15648@shrubbery.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

using libpq, is it possible to get a list of tables (psql: \d equivalent),
list of fields for each of those tables (psql: \d <table>), and types for
each of the fields for a given container?

there doesnt seem to be a way to do any of these, except for getting the
field type of a returned tuple with PQftype() and looking up the returned
oid in the pg_attribute.

it does appear to be possible to query system tables (psql: \dS) for some
of this data, such as pg_tables for a list of tables. yet there doesnt
appear to be a way to associate these entries to a particular datbase
container. am i missing some way to glue these tables together to get a
list of tables per-container and fields per-table?

tia,
-heas

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2001-12-29 23:07:57 Re: Casting Varchar to Numeric
Previous Message Bruce Momjian 2001-12-29 20:36:29 Re: Casting Varchar to Numeric