Re: dynamic DB descriptions

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Darren Sunley" <darrensunley(at)hotmail(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: dynamic DB descriptions
Date: 2004-08-13 19:05:18
Message-ID: 25976.1092423918@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

"Darren Sunley" <darrensunley(at)hotmail(dot)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

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Tom Lane 2004-08-13 20:24:54 Re: Pg_dump does not include database search path in backup file
Previous Message Tom Lane 2004-08-13 19:02:19 Re: TOAST tables keeps growing!