美文网首页
postgresql 查询表结构语句

postgresql 查询表结构语句

作者: 黑黑的大猫 | 来源:发表于2021-11-17 20:15 被阅读0次

SELECT col_description(a.attrelid, a.attnum)as comment,

      format_type(a.atttypid, a.atttypmod)as type,

      a.attname                            as name,

      a.attnotnull                          as notnull

FROM pg_classas c,

    pg_attributeas a

where c.relname ='persons'

  and a.attrelid =c.oid

  and a.attnum >0

相关文章

网友评论

      本文标题:postgresql 查询表结构语句

      本文链接:https://www.haomeiwen.com/subject/tvkrtrtx.html