Prezados,

Eu uso o seguinte sql para identificar as colunas do meu banco sem comentarios:
SELECT
'COMMENT ON COLUMN '||c.relname||'.'||a.attname ||' IS \'.\';' as COMENTARIOS
FROM pg_namespace n, pg_class c,
pg_attribute a, pg_type t
WHERE n.oid = c.relnamespace
AND c.relkind = 'r' -- sem índices
AND n.nspname not like 'pg\\_%' -- sem catálogos
AND n.nspname = 'public' -- COM ESPECIFICACAO DO schema
AND a.attnum > 0 -- sem atributo de sistema
AND not a.attisdropped -- sem colunas removidas
AND c.relname ILIKE 'ressarcimento%'
and ( select coalesce(d.description,'') as desc from pg_description d
where d.objoid=a.attrelid and d.objsubid=a.attnum) is null
AND a.attrelid = c.oid AND a.atttypid = t.oid ORDER BY nspname,
relname, attname;

Alguem poderia me ajudar a fazer um sql para identificar as tabelas
que estao sem comentarios? (obs: no caso me refiro sem o "comment
table")
_______________________________________________
pgbr-geral mailing list
[email protected]
https://listas.postgresql.org.br/cgi-bin/mailman/listinfo/pgbr-geral

Responder a