Search Postgresql Archives

Re: column information from view

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"Sebastian P. Luque" <spluque@xxxxxxxxx> writes:
> Tom Lane <tgl@xxxxxxxxxxxxx> wrote:
>> Personally, I'd probably write it something like this:

>> select pa.attnum, pa.attname, col_description(pa.attrelid, pa.attnum)
>> from pg_attribute pa, pg_attribute ta where pa.attrelid =
>> 'persistent_view'::regclass and ta.attrelid =
>> 'temporary_view'::regclass and pa.attname = ta.attname order by
>> pa.attnum;

> Thank you Tom, this does seem more elegant, but I'd have to retrieve the
> actual "attrelid" from the names of the two views somehow.

That's what the regclass converter does for you.

			regards, tom lane




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux