Re: Get Comments on Tables / Functions

Поиск
Список
Период
Сортировка
От Thomas Kellerer
Тема Re: Get Comments on Tables / Functions
Дата
Msg-id hh7qa6$36a$1@ger.gmane.org
обсуждение исходный текст
Ответ на Get Comments on Tables / Functions  (Alex - <aintokyo@hotmail.com>)
Список 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 по дате отправления:

Предыдущее
От: Alex -
Дата:
Сообщение: Get Comments on Tables / Functions
Следующее
От: Rob Jaeger
Дата:
Сообщение: Re: Finding the bin path