Re: OIDs missing in pg_attribute? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: OIDs missing in pg_attribute?
Date
Msg-id 29740.1007739744@sss.pgh.pa.us
Whole thread Raw
In response to OIDs missing in pg_attribute?  ("Marc G. Fournier" <scrappy@hub.org>)
Responses Re: OIDs missing in pg_attribute?
List pgsql-hackers
"Marc G. Fournier" <scrappy@hub.org> writes:
>     v7.2b3 no longer has an OID on pg_attribute?

Yup.

>     Is this intentional? :(

Yup.

>     The following works great in v7.1.3, but fails in v7.b3:

>  select upper(c.relname) as table_name,
>          upper(a.attname) as column_name,
>          d.description as comments
>     from pg_class c,
>          pg_attribute a
>            left outer join pg_description d on (a.oid = d.objoid)
>    where c.oid = a.attrelid
>      and a.attnum > 0;

This would not work anyway in 7.2, since the primary key of
pg_description is now (objoid,classoid,objsubid) not just (objoid).
I'd recommend using col_description(a.attrelid, a.attnum) rather
than the explicit join against pg_description.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [SQL] how to change the type
Next
From: Thomas Lockhart
Date:
Subject: Third call for platform testing