pgsql 获取表字段 字段类型 注释
获取字段名、类型、注释、是否为空:SELECTcol_description ( A.attrelid, A.attnum ) AS COMMENT,format_type ( A.atttypid, A.atttypmod ) AS TYPE,A.attname AS NAME,A.attnotnull AS NOTNULLFROMpg_class AS C,pg_attribute AS AW
·
获取字段名、类型、注释、是否为空:
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_class AS C,
pg_attribute AS A
WHERE
C.relname = '表名'
AND A.attrelid = C.oid
AND A.attnum > 0
原文链接:https://blog.csdn.net/cicon/article/details/51577655
更多推荐
已为社区贡献4条内容
所有评论(0)