postgresql查看表结构和字段注释 一:查看表结构(字段)信息:Select table_name,column_name,data_type,character_maximum_len
一:查看表结构(字段)信息:
Select table_name,column_name,data_type,character_maximum_length from infORMation.columns where table_schema='dd' and table_name='department';
二:查看字段注释信息:
Select a.attnum,(select description from pg_catalog.pg_description where objoid=a.attrelid and objsubid=a.attnum) as descript ,a.attname,pg_catalog.format_type(a.atttypid,a.atttypmod) as data_type from pg_catalog.pg_attribute a where 1=1 and a.attrelid=(select oid from pg_class where relname='department' ) and a.attnum>0 and not a.attisdropped order by a.attnum;
- 注释:其中dd为schema名字,department为表名*
--结束END--
本文标题: Postgresql查看表结构和字段注释
本文链接: https://lsjlt.com/news/37567.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
2024-10-23
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0