SELECT a.attnum
, a.attname AS field
, b.description AS comment
, t.typname AS type
, a.attlen AS length
, a.atttypmod AS lengthvar
, a.attnotnull AS notnull
FROM pg_class c,
pg_attribute a
LEFT JOIN pg_description b
ON a.attrelid = b.objoid
AND a.attnum = b.objsubid,
pg_type t
WHERE c.relname = 'table_name'
AND a.attnum > 0
AND a.attrelid = c.oid
AND a.atttypid = t.oid
ORDER BY a.attnum;
pgsql查看字段注释
最新推荐文章于 2024-09-10 14:35:22 发布