查询字段描述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 ;
时间: 2024-10-13 11:32:29