Thread: List Foreign Key Relationships

List Foreign Key Relationships

From
Tim Jones
Date:
Hi All

I am try to query the dictionary to get a list of the foreign key
relationships in the dictionary.
Say in the form Primary Key Table, Primary Column(s), Foreign Key Table,
Foreing Key Column(s)
Any ideas. I suppose I could try and unpack the bytea in pg_trigger. Any
other ideas?

Tim


Re: List Foreign Key Relationships

From
Stephan Szabo
Date:
On Wed, 2 Oct 2002, Tim Jones wrote:

> Hi All
>
> I am try to query the dictionary to get a list of the foreign key
> relationships in the dictionary.
> Say in the form Primary Key Table, Primary Column(s), Foreign Key Table,
> Foreing Key Column(s)
> Any ideas. I suppose I could try and unpack the bytea in pg_trigger. Any
> other ideas?

Fortunately other people have already done that.  I believe one of the
documents on techdocs.postgresql.org goes into it or failing that it's
possible there's something in the PostgreSQL cookbook (which should also
be linked to by techdocs)