"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