본문 바로가기

웹개발

[postgreSQL] 컬럼주석(코멘트) 조회

select
    c.relname as table_name
    , a.attname as column_name
    , d.description as column_comment
    , d.*
from
    pg_description d
join pg_attribute a on
    d.objoid = a.attrelid
    and d.objsubid = a.attnum
join pg_class c on
    c.oid = a.attrelid
where
    c.relname like '%테이블명%'
    and d.description like '%컬럼주석%'