Re: REFERENCES Constraint - Mailing list pgsql-general

From Stephan Szabo
Subject Re: REFERENCES Constraint
Date
Msg-id Pine.BSF.4.21.0107181119350.30757-100000@megazone23.bigpanda.com
Whole thread Raw
In response to REFERENCES Constraint  (Pavel Fryc <Pavel.Fryc@oskarmobil.cz>)
List pgsql-general
On Wed, 18 Jul 2001, Pavel Fryc wrote:

> Is there a way to find out for given row and column what other tables/rows
> reference this row/column by means of reference integrity. I need this when
> user deletes number of rows from a table and there is integrity violation I
> want to get a list of tables/rows that cause the violation for user to
> review.
> I need help from You with this my problem.

It's not really easy, you need to get the references information out of
pg_trigger (see the archives for more information) and then given that
you could probably formulate the query necessary to get the rows (you'd
probably want to look at backend/utils/adt/ri_triggers.c at the noaction
triggers for information on how to make the query).


pgsql-general by date:

Previous
From: Mike Castle
Date:
Subject: Re: Re: sick DB - ??
Next
From: "Ryan C. Bonham"
Date:
Subject: RE: THIS IS NOT RELATED TO THE RDBMS BUT PLEEEEEEEEEEEE EASE