테이블 코멘트 조회 SQL
SELECT n.nspname, c.relname, obj_description(c.oid)
FROM pg_catalog.pg_class c inner join pg_catalog.pg_namespace n on c.relnamespace=n.oid
WHERE c.relkind = 'r' and nspname='<스키마명>';
컬럼 코멘트 조회 SQL
select c.relname, a.attrelid as "tableoid",
a.attname as "colname",
a.attnum as "columnoid",
(SELECT col_description(a.attrelid, a.attnum)) AS COMMENT
from
pg_catalog.pg_class c
inner join pg_catalog.pg_attribute a on a.attrelid = c.oid
where
c.relname = '<테이블명>'
a.attnum > 0
and a.attisdropped is false
and pg_catalog.pg_table_is_visible(c.oid)
order by a.attrelid, a.attnum;
직접 수행한후 결과를 살펴보세요.