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;
PGSQL获取所有表结构
最新推荐文章于 2024-07-23 16:45:34 发布