pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Susan Hurst <susan.hurst@brookhurstdata.com>
To: Discuss List Postgres <pgsql-general@lists.postgresql.org>
Subject: Displaying Comments in Views
Date: Mon, 28 Jan 2019 09:08:13 -0600
Message-ID: <8d48b89ca871afcce64a6b78d2db2b0c@mail.brookhurstdata.net> (raw)

What is the trick for displaying column comments in views?

The query below works as expected when the table_schema includes tables, 
however it shows nothing when the table_schema contains only views.  I 
tried putting the query into an inline statement as a column selection 
in a wrapper query...I got all the table/column data but the comment 
column values were all null.

There must be a way to display comments if I can display the 
table/column definitions, especially since the query joins directly to 
information_schema columns.  What am I missing?

Thanks for your help!

Sue

select c.table_schema
       ,c.table_name
       ,c.column_name
       ,pd.description
   from pg_catalog.pg_statio_all_tables  st
       ,pg_catalog.pg_description        pd
       ,information_schema.columns       c
where pd.objoid = st.relid
    and pd.objsubid = c.ordinal_position
    and c.table_schema = st.schemaname
    and c.table_name = st.relname
    and c.table_schema = 'devops'
order by c.table_schema
          ,c.table_name
          ,c.column_name
;

-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Susan E Hurst
Principal Consultant
Brookhurst Data LLC
Email: susan.hurst@brookhurstdata.com
Mobile: 314-486-3261




view thread (5+ messages)  latest in thread

Message-ID: <8d48b89ca871afcce64a6b78d2db2b0c@mail.brookhurstdata.net>
Permalink:  ../8d48b89ca871afcce64a6b78d2db2b0c@mail.brookhurstdata.net/
Also on:    postgresql.org/message-id/8d48b89ca871afcce64a6b78d2db2b0c@mail.brookhurstdata.net

 · 

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: susan.hurst@brookhurstdata.com
  Subject: Re: Displaying Comments in Views
  In-Reply-To: <8d48b89ca871afcce64a6b78d2db2b0c@mail.brookhurstdata.net>
  References: <8d48b89ca871afcce64a6b78d2db2b0c@mail.brookhurstdata.net>

* 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