Re: column information from view - Mailing list pgsql-general

From Sebastian P. Luque
Subject Re: column information from view
Date
Msg-id 874lerjy6n.fsf@otaria.sebmel.org
Whole thread Raw
In response to column information from view  ("Sebastian P. Luque" <spluque@gmail.com>)
List pgsql-general
On Fri, 14 Sep 2018 18:29:27 -0400,
Tom Lane <tgl@sss.pgh.pa.us> wrote:

> "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.

Amazing!

Thank you all for these insights,
-- 
Seb



pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Vacuum not deleting tuples when lockless
Next
From: Jerry Sievers
Date:
Subject: Re: Vacuum not deleting tuples when lockless