Re: dynamic DB descriptions - Mailing list pgsql-admin

From Tom Lane
Subject Re: dynamic DB descriptions
Date
Msg-id 25976.1092423918@sss.pgh.pa.us
Whole thread Raw
In response to dynamic DB descriptions  ("Darren Sunley" <darrensunley@hotmail.com>)
List pgsql-admin
"Darren Sunley" <darrensunley@hotmail.com> writes:
> I was just wondering if anyone new of a way of pulling out the attribute
> names of a table on the fly.

Basically

select attname from pg_attribute where
  attrelid = (select oid from pg_class where relname = 'foo');

For examples of getting fancier, try running psql with -E option and
do "\d foo".  Also read the "system catalogs" chapter in the documentation.

            regards, tom lane

pgsql-admin by date:

Previous
From: Tom Lane
Date:
Subject: Re: Pg_dump does not include database search path in backup file
Next
From: Tom Lane
Date:
Subject: Re: TOAST tables keeps growing!