Re: column information from view

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: column information from view
Дата
Msg-id 3830.1536964167@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: column information from view  (Sebastian P. Luque <spluque@gmail.com>)
Список pgsql-general
"Sebastian P. Luque" <spluque@gmail.com> writes:
> Tom Lane <tgl@sss.pgh.pa.us> 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


В списке pgsql-general по дате отправления:

Предыдущее
От: Sebastian P. Luque
Дата:
Сообщение: Re: column information from view
Следующее
От: Chris Williams
Дата:
Сообщение: Re: Slow shutdowns sometimes on RDS Postgres