Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1go8WI-0005JC-Nv for pgsql-general@arkaria.postgresql.org; Mon, 28 Jan 2019 15:08:18 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1go8WH-0001cd-IS for pgsql-general@arkaria.postgresql.org; Mon, 28 Jan 2019 15:08:17 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1go8WH-0001bG-7I for pgsql-general@lists.postgresql.org; Mon, 28 Jan 2019 15:08:17 +0000 Received: from 24-182-127-154.static.stls.mo.charter.com ([24.182.127.154] helo=mail.brookhurstdata.net) by makus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1go8WE-00067t-Sk for pgsql-general@lists.postgresql.org; Mon, 28 Jan 2019 15:08:16 +0000 Received: from mail.brookhurstdata.net (mail.brookhurstdata.net [10.1.5.12]) by mail.brookhurstdata.net (Postfix) with ESMTP id 8FFF288901D for ; Mon, 28 Jan 2019 09:08:13 -0600 (CST) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Date: Mon, 28 Jan 2019 09:08:13 -0600 From: Susan Hurst To: Discuss List Postgres Subject: Displaying Comments in Views Organization: Brookhurst Data LLC Reply-To: susan.hurst@brookhurstdata.com Mail-Reply-To: susan.hurst@brookhurstdata.com Message-ID: <8d48b89ca871afcce64a6b78d2db2b0c@mail.brookhurstdata.net> X-Sender: susan.hurst@brookhurstdata.com User-Agent: Roundcube Webmail/RCMAIL_VERSION List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk 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