1.postgreSQL 查看表字段
SELECT
a.attname as 字段名,
format_type(a.atttypid,a.atttypmod) as 类型,
a.attnotnull as 非空,
col_description(a.attrelid,a.attnum) as 注释
FROM pg_class as c,pg_attribute as a
WHERE
a.attrelid = c.oid
and a.attnum>0
and c.relname = 'b_dict';
2.postgreSQL 查看表索引
select * from pg_indexes where tablename='b_dict';
select * from pg_statio_all_indexes where relname='b_dict';
3.postgreSQL 查看表序列
relkind字段:r =普通表, i =索引,S =序列,v =视图,m =物化视图, c =复合类型,t = TOAST表,f =外部表
select * from pg_class where relkind='S' and relname like 'b_dict%';