Re: column information from view

From: "Sebastian P(dot) Luque" <spluque(at)gmail(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: column information from view
Date: 2018-09-14 22:17:43
Message-ID: 87efdv3erc.fsf@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, 14 Sep 2018 14:47:07 -0700,
Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com> wrote:

> SELECT cols.ordinal_position, cols.column_name,
> col_description(cl.oid, cols.ordinal_position::INT)
> FROM pg_class cl, information_schema.columns cols
> WHERE cols.table_catalog='aquaculture' AND cols.table_schema ilike
> 'pg_temp%' AND
> cols.table_name = 'c_data' AND cols.table_name = cl.relname
> ORDER BY cols.ordinal_position::INT;

> ordinal_position | column_name | col_description
> ------------------+----------------+-----------------
> 1 | source_id | NULL
> 2 | geography_desc | NULL

Exactly, except that the column descriptions reside in the persistent
view whereas the above pulls them from the temporary view, which are all
NULL.

Always learning something here.

Thanks,
--
Seb

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Sebastian P. Luque 2018-09-14 22:24:45 Re: column information from view
Previous Message Andres Freund 2018-09-14 22:02:42 Re: commit timestamps and replication