PGSQL get all table structure

select
col.table_name as 表名,
col.column_name as 字段名,
col.data_type as 字段类型,
des.description as 字段描述
from
information_schema.columns col left join pg_description des on
col.table_name::regclass = des.objoid
and col.ordinal_position = des.objsubid
where
table_schema = 'public'
--and table_name = 'xxx'
order by
col.table_name;

Guess you like

Origin blog.csdn.net/ccagy/article/details/108757623