开发者社区 > 大数据与机器学习 > 实时数仓 Hologres > 正文

如何查看表的所有字段的备注信息?

如何查看表的所有字段的备注信息?

展开
收起
小赵赵赵赵 2022-01-27 16:39:27 4251 0
1 条回答
写回答
取消 提交回答
  • --查看所有有备注的字段
    select c.relname 表名,cast(obj_description(relfilenode,'pg_class') as varchar) 名称,a.attname 字段,d.description 字段备注,concat_ws('',t.typname,SUBSTRING(format_type(a.atttypid,a.atttypmod) from '\(.*\)')) as 列类型 
    from pg_class c,pg_attribute a,pg_type t,pg_description d
    where a.attnum>0 and a.attrelid=c.oid and a.atttypid=t.oid and d.objoid=a.attrelid and d.objsubid=a.attnum
    and c.relname in (select tablename from pg_tables where schemaname='public' and position('_2' in tablename)=0) order by c.relname,a.attnum
    
    2022-01-27 16:40:00
    赞同 展开评论 打赏

本技术圈将为大家分析有关阿里云产品Hologres的最新产品动态、技术解读等,也欢迎大家加入钉钉群--实时数仓Hologres交流群32314975

相关电子书

更多
低代码开发师(初级)实战教程 立即下载
冬季实战营第三期:MySQL数据库进阶实战 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载