[PostgreSQL] 테이블 정의서 쿼리


[PostgreSQL] 테이블 정의서 쿼리

-- table정의서 추출 select T.table_catalog as "db명" , T.table_schema as "스키마명" , T.table_name as "테이블ID" , coalesce((select PD.DESCRIPTION from PG_STAT_USER_TABLES PS , PG_DESCRIPTION PD where PS.RELNAME = T.table_name and PS.schemaname = T.table_schema and PS.RELID = PD.OBJOID and PD.OBJSUBID = 0 ), 'NULL' ) as "테이블명" , T.ordinal_position as "컬럼순서" , T.column_name as "컬럼ID" , coalesce((select PD.DES..


원문링크 : [PostgreSQL] 테이블 정의서 쿼리