Thread: schema inspection

schema inspection

From
"rcolmegna@tiscali.it"
Date:
Hi,

supposing to have a small DB:

TABLE a ( id SERIAL PRIMARY KEY
);

TABLE b ( id SERIAL PRIMARY KEY, idA INTEGER NOT NULL REFERENCES a(id)
);

How can I inspect pg_schema/information_schema to "detect" the
relation between "b" and "a" via "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.tiscali.it/adsl/sa/4flat_tc/&a=webmail&z=webmail&t=14


Re: schema inspection

From
Achilleus Mantzios
Date:
O rcolmegna@tiscali.it έγραψε στις Mar 16, 2006 :

> Hi,
> 
> supposing to have a small DB:
> 
> TABLE a (
>   id SERIAL PRIMARY KEY
> );
> 
> TABLE b (
>   id SERIAL PRIMARY KEY,
>   idA INTEGER NOT NULL REFERENCES a(id)
> );
> 
> How can I inspect pg_schema/information_schema to "detect" the 
> relation between "b" and "a" via "idB"?
> 

pg_catalog.pg_constraint is your (only?) friend.

> 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
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 3: Have you checked our extensive FAQ?
> 
>                http://www.postgresql.org/docs/faq
> 

-- 
-Achilleus



Re: schema inspection

From
"Michael James"
Date:
Pgadmin is a good GUI interface if you want that same info, but pg_catalog is a better tool

-----Original Message-----
From: pgsql-sql-owner@postgresql.org [mailto:pgsql-sql-owner@postgresql.org] On Behalf Of Achilleus Mantzios
Sent: Thursday, March 16, 2006 9:45 AM
To: rcolmegna@tiscali.it
Cc: pgsql-sql@postgresql.org
Subject: Re: [SQL] schema inspection

O rcolmegna@tiscali.it έγραψε στις Mar 16, 2006 :

> Hi,
>
> supposing to have a small DB:
>
> TABLE a (
>   id SERIAL PRIMARY KEY
> );
>
> TABLE b (
>   id SERIAL PRIMARY KEY,
>   idA INTEGER NOT NULL REFERENCES a(id)
> );
>
> How can I inspect pg_schema/information_schema to "detect" the
> relation between "b" and "a" via "idB"?
>

pg_catalog.pg_constraint is your (only?) friend.

> 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
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: Have you checked our extensive FAQ?
>
>                http://www.postgresql.org/docs/faq
>

--
-Achilleus


---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to      choose an index scan if your joining column's
datatypesdo not      match 

iCrossing Privileged and Confidential Information
This email message is for the sole use of the intended recipient(s) and may contain confidential and privileged
informationof iCrossing. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the
intendedrecipient, please contact the sender by reply email and destroy all copies of the original message.