X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id E7B0A9DCC54 for ; Fri, 17 Mar 2006 05:38:40 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 29236-03 for ; Fri, 17 Mar 2006 05:38:42 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from mrqout2.tiscali.it (mrqout2.tiscali.it [195.130.225.12]) by postgresql.org (Postfix) with ESMTP id ABA639DCB94 for ; Fri, 17 Mar 2006 05:38:38 -0400 (AST) Received: from 10.39.115.25 by mrq-2 with esmtp (Exim) id 1FKBPs-0007wx-4y; Fri, 17 Mar 2006 10:38:40 +0100 Received: from ps20 (10.39.75.90) by mail-5.mail.tiscali.sys (7.2.066.3) id 4417DC3F000086BA; Fri, 17 Mar 2006 10:38:06 +0100 Message-ID: <33326472.1142588286517.JavaMail.root@ps20> Date: Fri, 17 Mar 2006 10:38:06 +0100 (CET) From: "rcolmegna@tiscali.it" Reply-To: "rcolmegna@tiscali.it" To: Achilleus Mantzios Subject: R: Re: R: Re: R: R: Re: schema inspection Cc: pgsql-sql@postgresql.org MIME-Version: 1.0 Content-Type: text/plain;charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.479 required=5 tests=[DNS_FROM_RFC_ABUSE=0.479] X-Spam-Score: 0.479 X-Spam-Level: X-Archive-Number: 200603/270 X-Sequence-Number: 24616 >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=20 it works (see below) [as you can see "C" table have two FK to A and B] test=3D> SELECT test-> (SELECT relname FROM pg_catalog.pg_class WHERE oid=3Dconrelid)=20 AS fromTbl, test-> (SELECT relname FROM pg_catalog.pg_class WHERE oid=3Dconfrelid)=20 AS toTbl, test-> (SELECT attname FROM pg_catalog.pg_attribute WHERE=20 attrelid=3Dconrelid AND conkey[1]=3Dattnum) AS viaCol test-> FROM pg_catalog.pg_constraint AS rel WHERE contype=3D'f' ORDER BY=20 fromTbl; fromtbl | totbl | viacol ---------+-------+-------- b | a | ida c | a | ida c | b | idb TIA Roberto Colmegna =09=09 Tiscali ADSL 4 Mega Flat Naviga senza limiti con l'unica Adsl a 4 Mega di velocit=C3=A0 a soli 19,95= =E2=82=AC al mese! Attivala subito e hai GRATIS 2 MESI e l'ATTIVAZIONE.=20 http://abbonati.tiscali.it/banner/middlepagetracking.html?c=3Dwebmailadsl&r= =3Dhttp://abbonati.tiscali.it/adsl/sa/4flat_tc/&a=3Dwebmail&z=3Dwebmail&t= =3D14