Re: Get Comments on Tables / Functions - Mailing list pgsql-general

From Thomas Kellerer
Subject Re: Get Comments on Tables / Functions
Date
Msg-id hh7qa6$36a$1@ger.gmane.org
Whole thread Raw
In response to Get Comments on Tables / Functions  (Alex - <aintokyo@hotmail.com>)
List pgsql-general
Alex - wrote on 27.12.2009 14:57:
> Hi,
> i am adding comments to tables and functions with version information
> and would like to extract that information through a query.
>
> Is there and easy way to do that? simple list. table_name, comment
>

SELECT n.nspname as schema_name,
        c.relname as table_name,
        a.attname as column_name,
        dsc.description
FROM pg_catalog.pg_namespace n
      JOIN pg_catalog.pg_class c ON (c.relnamespace = n.oid)
      JOIN pg_catalog.pg_attribute a ON (a.attrelid = c.oid)
      LEFT JOIN pg_catalog.pg_description dsc ON (c.oid = dsc.objoid AND a.attnum = dsc.objsubid)
WHERE a.attnum > 0
AND   NOT a.attisdropped
and   c.relname = 'account'

Regards
Thomas

pgsql-general by date:

Previous
From: Alex -
Date:
Subject: Get Comments on Tables / Functions
Next
From: Rob Jaeger
Date:
Subject: Re: Finding the bin path