Re: how to find referenced column and table

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: Jules Alberts <jules(dot)alberts(at)arbodienst-limburg(dot)nl>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: how to find referenced column and table
Date: 2002-12-16 16:30:35
Message-ID: 20021216082924.U61969-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


On Mon, 16 Dec 2002, Jules Alberts wrote:

> Now I'm building a PHP function that creates an HTML form to change one
> row of table CUSTOMER. It's a generic function, it should work on any
> table, and it should be able to recognise if a row references another
> table, so that a pulldown list can be created dynamically. In this case
> a pulldown with all COUNTRY codes in it.
>
> CUSTOMER
> code [ ]
> name [ ]
> country [pick one...[V]
>
> So what I'm looking for is a query that will tell me that row A of
> table B references row X of table Y. How would I do this?

I think someone just recently sent a function to the -sql (I think) list
to get the foreign key constraint information and I know that such
functions have been sent in the past so the archives and
techdocs.postgresql.org may be some help.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Harald Krake 2002-12-16 16:32:34 prepared statements and analyze in 7.3
Previous Message Robert Treat 2002-12-16 16:23:33 working around setQuerySnapshot limitations in functions