Postgresql 查询表结构脚本

栏目:eas cloud知识作者:金蝶来源:金蝶云社区发布:2024-09-16浏览:1

Postgresql 查询表结构脚本


SELECT a.attnum,a.attname AS field,t.typname AS type,a.attlen AS length,a.atttypmod AS lengthvar,a.attnotnull AS notnull,b.description AS comment

FROM pg_class c,pg_attribute a

LEFT OUTER JOIN pg_description b ON a.attrelid=b.objoid AND a.attnum = b.objsubid,

pg_type t

WHERE c.relname = lower('T_FW_UserCustomConfig')  --修改为要查询的表名

and a.attnum > 0 and a.attrelid = c.oid

and a.atttypid = t.oid ORDER BY a.attnum;



Postgresql 查询表结构脚本

SELECT a.attnum,a.attname AS field,t.typname AS type,a.attlen AS length,a.atttypmod AS lengthvar,a.attnotnull AS notnul...
点击下载文档
确认删除?
回到顶部
客服QQ
  • 客服QQ点击这里给我发消息