From: | "Tim Barnard" <tbarnard(at)povn(dot)com> |
---|---|
To: | <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: Clarification question |
Date: | 2002-01-20 19:05:02 |
Message-ID: | 007201c1a1e5$5d57c360$a519af3f@hartcomm.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Just a note... In order to get your suggestion to work I had to alter it
slightly:
select attname
from pf_attribute join pg_class p1 on attrelid=p1.oid
where relname='<insert table name here>'
and attnum > 0
Without the alias I get a "Column reference oid is ambiguous" error.
Tim Barnard
S.E. Mgr
Hartford Communications Corporation
----- Original Message -----
From: "Tommi Mäkitalo" <t(dot)maekitalo(at)epgmbh(dot)de>
To: "Tim Barnard" <tbarnard(at)povn(dot)com>
Sent: Sunday, January 20, 2002 10:53 AM
Subject: Re: [GENERAL] Clarification question
> Hi,
>
> You could use a join too. It will be simpler to optimize it:
>
> select attname
> from pg_attribute join pg_class on attrelid = oid
> where relname = '<insert table name here>'
> and attnum > 0
>
> Tommi
>
> ...
>
> >>>select attname from pg_attribute
> >>> where attrelid=
> >>> (select relfilenode from pg_class
> >>> where relname like <insert table name here>)
> >>> and attnum > 0
> >>>
> ...
>
> >>
> >>select attname from pg_attribute
> >> where attrelid=
> >> (select oid from pg_class
> >> where relname = '<insert table name here>')
> >> and attnum > 0
> >>
>
>
>
From | Date | Subject | |
---|---|---|---|
Next Message | Tim Barnard | 2002-01-20 19:07:58 | Re: Clarification question |
Previous Message | Tim Barnard | 2002-01-20 18:57:36 | Re: Clarification question |