数据库
首页 > 数据库> > Postgresql获得表字段结构信息包含注释

Postgresql获得表字段结构信息包含注释

作者:互联网

Select * From (
  Select
    a.relname FTableName,
    b.attname FFieldName,
    format_type(b.atttypid,b.atttypmod) as FFieldType,
    col_description(b.attrelid,b.attnum) FFieldDesc,
    b.attnum FNo,
    b.attnotnull FNotNull
  from
    (select oid, * from pg_class where relnamespace=2200 and reltype>0) a
  left join
    (select * From pg_catalog.pg_attribute where attnum>0 and atttypid>0 ) b
  on a.oid=b.attrelid
) A
Order by ftablename,fno

标签:Postgresql,oid,表字,attnum,注释,atttypid,pg,select,attrelid
来源: https://www.cnblogs.com/wuxuan/p/10433169.html