pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Sebastian P. Luque <spluque@gmail.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: column information from view
Date: Fri, 14 Sep 2018 17:17:43 -0500
Message-ID: <87efdv3erc.fsf@gmail.com> (raw)
In-Reply-To: <60527cd2-6c53-ddf0-901d-20b2221a1a3b@aklaver.com>
References: <87in373gpd.fsf@gmail.com>
	<60527cd2-6c53-ddf0-901d-20b2221a1a3b@aklaver.com>

On Fri, 14 Sep 2018 14:47:07 -0700,
Adrian Klaver <adrian.klaver@aklaver.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




view thread (9+ messages)  latest in thread

Message-ID: <87efdv3erc.fsf@gmail.com>
Permalink:  ../87efdv3erc.fsf@gmail.com/
Also on:    postgresql.org/message-id/87efdv3erc.fsf@gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: spluque@gmail.com
  Subject: Re: column information from view
  In-Reply-To: <87efdv3erc.fsf@gmail.com>
  References: <87in373gpd.fsf@gmail.com> <60527cd2-6c53-ddf0-901d-20b2221a1a3b@aklaver.com> <87efdv3erc.fsf@gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox