Subject: Re: retrieving class attributes

From: "Patrick M. Landry" <[email-masked]>
Date: Thu, 11 Jun 92 16:01:02 -0700

>
>In message <[email-masked]> you write:
>
>> I want to retrieve (find) what the attributes (name, type) are of a class.
>
>either
>	retrieve (foo.all) where 1=0
>or
>	retrieve (a.attname, t.typname) from a in pg_attribute,
>	t in pg_type, r in pg_class where a.attrelid = r.oid
>	and a.attypid = t.oid and r.relname = "foo"
>
>will give you schema info for 'foo'.  the longer query shows all
>atts, system as well as user, and shows type names.  the former is
>faster.
>					mike
>

Is the former documented anywhere? I have been using the latter and others
like it to get database meta-data.
--
patrick

---

From: <[email-masked]>
Date: Thu, 11 Jun 92 16:10:41 PDT

> like it to get database meta-data.

well, it's just a query that returns no rows (since there exists no tuple
for which 1 = 0).  queries always show their target lists.  it's not
documented as a special command, no; it's not really worth the trouble.

					mike