From: rcolmegna@tiscali.it <rcolmegna@tiscali.it>
To: Achilleus Mantzios <achill@matrix.gatewaynet.com>
Cc: pgsql-sql@postgresql.org
Subject: R: Re: R: Re: R: R: Re: schema inspection
Date: Fri, 17 Mar 2006 10:38:06 +0100 (CET)
Message-ID: <33326472.1142588286517.JavaMail.root@ps20> (raw)
>Well thats it if you use only *single column* Foreign keys.
>In the general case the above will need extra work.
Are you sure? I have tested query with 3 table with multiple FK and
it works (see below) [as you can see
"C" table have two FK to A and B]
test=> SELECT
test-> (SELECT relname FROM pg_catalog.pg_class WHERE oid=conrelid)
AS fromTbl,
test-> (SELECT relname FROM pg_catalog.pg_class WHERE oid=confrelid)
AS toTbl,
test-> (SELECT attname FROM pg_catalog.pg_attribute WHERE
attrelid=conrelid AND conkey[1]=attnum) AS viaCol
test-> FROM pg_catalog.pg_constraint AS rel WHERE contype='f' ORDER BY
fromTbl;
fromtbl | totbl | viacol
---------+-------+--------
b | a | ida
c | a | ida
c | b | idb
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.tiscal...
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: rcolmegna@tiscali.it, achill@matrix.gatewaynet.com
Subject: Re: R: Re: R: Re: R: R: Re: schema inspection
In-Reply-To: <33326472.1142588286517.JavaMail.root@ps20>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox