查询字段描述sql

 

SELECT 'comment on column ' || n.nspname ||'.'|| c.relname || '.' || a.attname ||' is '''|| col_description(a.attrelid,a.attnum) ||''';'
FROM pg_class as c
join pg_attribute as a on a.attrelid = c.oid
join pg_namespace n on c.relnamespace=n.oid
where n.nspname = 'cty_189' and c.relname = 'jd_template'  and a.attnum>0 and col_description(a.attrelid,a.attnum) is not null
order by attnum ;

 

相关文章:

  • 2022-02-10
  • 2022-12-23
  • 2022-02-28
  • 2021-12-31
  • 2021-11-19
  • 2021-10-19
  • 2021-06-02
  • 2021-06-27
猜你喜欢
  • 2022-02-17
  • 2021-06-20
  • 2022-12-23
  • 2022-12-23
  • 2021-11-03
  • 2021-12-07
  • 2021-09-18
相关资源
相似解决方案