Postgresql查看表结构和字段注释-成都快上网建站

Postgresql查看表结构和字段注释

Postgresql查看表结构和字段注释

一:查看表结构(字段)信息:
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;

目前创新互联建站已为1000+的企业提供了网站建设、域名、网站空间、网站托管维护、企业网站设计、丹棱网站维护等服务,公司将坚持客户导向、应用为本的策略,正道将秉承"和谐、参与、激情"的文化,与客户和合作伙伴齐心协力一起成长,共同发展。

  • 注释:其中dd为schema名字,department为表名*

当前文章:Postgresql查看表结构和字段注释
文章路径:http://kswjz.com/article/igehcs.html
扫二维码与项目经理沟通

我们在微信上24小时期待你的声音

解答本文疑问/技术咨询/运营咨询/技术建议/互联网交流