R: Re: R: R: Re: schema inspection

From: "rcolmegna(at)tiscali(dot)it" <rcolmegna(at)tiscali(dot)it>
To: Achilleus Mantzios <achill(at)matrix(dot)gatewaynet(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: R: Re: R: R: Re: schema inspection
Date: 2006-03-17 08:56:54
Message-ID: 19570915.1142585814389.JavaMail.root@ps20
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

>
>SELECT c1.relname,c2.relname from pg_constraint cons,pg_class c1,
pg_class
>c2 where cons.conrelid=c1.oid and cons.confrelid = c2.oid;
>
>for column(s) names you will have to do extra homework.

Thanks! I have obtained my query! Here is:

SELECT
(SELECT relname FROM pg_catalog.pg_class WHERE oid=conrelid) AS
fromTbl,
(SELECT relname FROM pg_catalog.pg_class WHERE oid=confrelid) AS
toTbl,
(SELECT attname FROM pg_catalog.pg_attribute WHERE attrelid=conrelid
AND conkey[1]=attnum) AS viaCol
FROM pg_catalog.pg_constraint AS rel WHERE contype='f';

TIA
Roberto Colmegna


Tiscali ADSL 4 Mega Flat
Naviga senza limiti con l'unica Adsl a 4 Mega di velocità a soli 19,95 € al mese!
Attivala subito e hai GRATIS 2 MESI e l'ATTIVAZIONE.
http://abbonati.tiscali.it/banner/middlepagetracking.html?c=webmailadsl&r=http://abbonati.tiscali.it/adsl/sa/4flat_tc/&a=webmail&z=webmail&t=14

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message rcolmegna@tiscali.it 2006-03-17 09:38:06 R: Re: R: Re: R: R: Re: schema inspection
Previous Message Richard Huxton 2006-03-17 08:11:50 Re: About how to use "exception when ??? then "