Re: Foreign keys - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Foreign keys
Date
Msg-id 6967.1157900971@sss.pgh.pa.us
Whole thread Raw
In response to Re: Foreign keys  (Stephan Szabo <sszabo@megazone.bigpanda.com>)
Responses Re: Foreign keys  (Gregory Stark <gsstark@mit.edu>)
List pgsql-hackers
Stephan Szabo <sszabo@megazone.bigpanda.com> writes:
> I think if we were going to do this that all the constraint violations for
> unique, not null, check and foreign keys should be handled similarly, so
> we'd probably want something more general than just a way for the ri
> triggers to do this. I don't have a good idea of the right solution for
> that though.

It seems pretty unwieldy to me: it's not hard to imagine a long INSERT
throwing millions of separate foreign-key errors before it's done, for
instance.  And then there's the cascading-errors problem, ie, bogus
reports that happen because some prior step failed ... not least being
your client crashing and failing to tell you anything about what
happened because it ran out of memory for the error list.

My advice is to rethink the client code that wants such a behavior.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Stephan Szabo
Date:
Subject: Re: Foreign keys
Next
From: "Jeremy Kronuz"
Date:
Subject: Re: ISBN/ISSN/ISMN/EAN13 module