Re: Help...

Lists: pgsql-general
From: "sheetal" <sheetal(at)anantinfotech(dot)com>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Help...
Date: 2002-06-05 20:06:36
Message-ID: 001801c20ccc$80b989e0$2264a8c0@sheetal
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Is there any table in postgres ,for eg pg_constraints, where in i can get the references for all the fields of a particular table in the data base?
Consider this..
I have
item master -- Item_code, Item Name
supplier master -- supplier_code, supplier_name
supplier_item_catalogue -- supplier_code references supplier master, item_code references item master

Now , if i select table supplier_item_catalogue for any reason from pg_tables, i should know that related tables item_master and supplier_master are also to be selected.

How can i do this using php /postgres?



From: Joel Burton <joel(at)joelburton(dot)com>
To: sheetal <sheetal(at)anantinfotech(dot)com>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: Help...
Date: 2002-06-07 03:56:17
Message-ID: Pine.LNX.4.30.0206062355350.20118-100000@temp.joelburton.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

On Wed, 5 Jun 2002, sheetal wrote:

> Is there any table in postgres ,for eg pg_constraints, where in i can get the references for all the fields of a particular table in the data base?
> Consider this..
> I have
> item master -- Item_code, Item Name
> supplier master -- supplier_code, supplier_name
> supplier_item_catalogue -- supplier_code references supplier master, item_code references item master
>
> Now , if i select table supplier_item_catalogue for any reason from pg_tables, i should know that related tables item_master and supplier_master are also to be selected.
>
> How can i do this using php /postgres?

There's some help in techdocs.postgresql.org, in the mini-HOWTO I wrote on
Hacking the Referential Integrity Tables. This should point you in the
right direction.

-J.
--

Joel BURTON | joel(at)joelburton(dot)com | joelburton.com | aim: wjoelburton
Independent Knowledge Management Consultant