Em 11 de junho de 2015 09:29, Márcio A. Sepp <[email protected]>
escreveu:

>
>
> Bom dia,
>
>
>
>
>
> Preciso pegar os comentários das tabelas, dos campos, constraints...  onde
> eu consigo encontrar no catálogo estas informações?
>
>
>
>
>
> Att.
>
> Márcio A. Sepp
>
>
>
> _______________________________________________
> pgbr-geral mailing list
> [email protected]
> https://listas.postgresql.org.br/cgi-bin/mailman/listinfo/pgbr-geral
>
> bom dia

abaixo comando que utilizo, no where passo algumas tabelas, vc pode colocar
todas se quizer, veja se te ajuda

select
pg_catalog.format_type(a.atttypid, a.atttypmod) as "Datatype",  c.relname,
a.attname  as colname  ,col_description(c.oid, a.attnum) AS comentario
from
    pg_catalog.pg_attribute a
    inner join pg_catalog.pg_class c on a.attrelid = c.oid
where  c.relname in
('cadimpfiscal','cadimposto','cadinsumo','cadproduto','cadunidade','comprov','configura','cupom','detcupom','detformapag','detreducao','hash','reducao','saldosetor')
 and a.attnum > 0 and col_description(c.oid, a.attnum) is not null
order by c.relname


-- 

Douglas Fabiano Specht
_______________________________________________
pgbr-geral mailing list
[email protected]
https://listas.postgresql.org.br/cgi-bin/mailman/listinfo/pgbr-geral

Responder a