2010/4/13 Thiago <[email protected]>:
> Galera, valeu pela ajuda.
>
> Consegui aqui vendo alguns exemplos da net, segue o sql para quem
> precisar fazer a mesma consulta.
>
> select *
> from pg_attribute
> where
>    attstattarget = -1 and
>    attrelid = (
>       select pg_class.oid as table_id
>       from pg_class
>       left join pg_namespace on pg_class.relnamespace = pg_namespace.oid
>       where

Usa INFORMATION_SCHEMA e Simplifica:

SELECT * FROM information_schema.columns
 WHERE table_schema = 'SEU_SCHEMA'
      AND table_name = 'TABELA';

Abraço!

-Leo
-- 
Leonardo Cezar
http://www.aslid.org.br
http://postgreslogia.wordpress.com
_______________________________________________
pgbr-geral mailing list
[email protected]
https://listas.postgresql.org.br/cgi-bin/mailman/listinfo/pgbr-geral

Responder a