pgsql查询表中字段名,类型,备注以及是否非空
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 = 'dm_ass_gp_income' AND A.attrelid = C.oid AND A.attnum >0