database field list

Started by Sebalmost 15 years ago3 messagesgeneral
Jump to latest
#1Seb
spluque@gmail.com

Hi,

I've been scouring the system tables for a way to return a list of
fields across all tables of a database. I see that pg_attribute is the
one to query here, but I'm not sure how to rule out system fields.
Thanks in advance for any pointers.

Cheers,

--
Seb

#2Thomas Kellerer
spam_eater@gmx.net
In reply to: Seb (#1)
Re: database field list

Seb wrote on 29.05.2011 23:04:

Hi,

I've been scouring the system tables for a way to return a list of
fields across all tables of a database. I see that pg_attribute is the
one to query here, but I'm not sure how to rule out system fields.
Thanks in advance for any pointers.

information_schema.columns is probably easier to look at:

http://www.postgresql.org/docs/current/static/infoschema-columns.html

Thomas

#3Seb
spluque@gmail.com
In reply to: Seb (#1)
Re: database field list

On Sun, 29 May 2011 23:11:50 +0200,
Thomas Kellerer <spam_eater@gmx.net> wrote:

Seb wrote on 29.05.2011 23:04:

Hi,

I've been scouring the system tables for a way to return a list of
fields across all tables of a database. I see that pg_attribute is
the one to query here, but I'm not sure how to rule out system
fields. Thanks in advance for any pointers.

information_schema.columns is probably easier to look at:

http://www.postgresql.org/docs/current/static/infoschema-columns.html

This is perfect!

Thanks,

--
Seb