What is the best way to select all user defined field names in a table?

From: "Yasuo Ohgaki" <yasuo_ohgaki(at)hotmail(dot)com>
To: <pgsql-general(at)postgresql(dot)org>
Subject: What is the best way to select all user defined field names in a table?
Date: 2001-02-28 05:55:32
Message-ID: OE72qLAUtMumY2MIa6R00001ec9@hotmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I'm wandering what is the best way to get all user fields from a table using
SQL.

With following SQL, I get extra field names that is not defined by user.
(cmax,
cmin, etc)

select a.attname from pg_class as c, pg_attribute as a where c.oid =
a.attrelid and c.relname = 'table_name';

It seems pg_attribute does not have flag to distinguish user defined fields.
(Is it?)
An option is excluding all system fields in where clause one by one, but I
thought there might be a better way to do that. (I searched recent mail list
archive, couldn't find one)

Thanks,

--
Yasuo Ohgaki

Responses

Browse pgsql-general by date

  From Date Subject
Next Message will trillich 2001-02-28 06:29:14 Re: postgresql upgrade/downgrade -- help!
Previous Message Bill Barnes 2001-02-28 05:21:22 RE: postgresql-tcl-7.03 requires libtcl8.0.so