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://myzitong.com/article/igehcs.html