Re: [PATCH] Support for foreign keys with arrays - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [PATCH] Support for foreign keys with arrays
Date
Msg-id 2334.1321508694@sss.pgh.pa.us
Whole thread Raw
In response to Re: [PATCH] Support for foreign keys with arrays  (Josh Berkus <josh@agliodbs.com>)
List pgsql-hackers
Josh Berkus <josh@agliodbs.com> writes:
>> BTW, has anyone thought through whether this is a sane idea at all?
>> It seems to me to be full of cases that will require rather arbitrary
>> decisions, like whether ON DELETE CASCADE should involve deleting the
>> whole row or just one array element.

> One array element, presumably.

Um, why?  One reasonable interpretation of an array reference is that
the row depends on *all* of the referenced pkeys.  Also, if you do
delete one array element at a time, what do you do when the array
becomes empty --- delete the row, or not, and in each case what's your
semantic justification for that choice?

In short, "presumably" doesn't cut it here.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Jaime Casanova
Date:
Subject: Re: [PATCH] Support for foreign keys with arrays
Next
From: Hitoshi Harada
Date:
Subject: Re: (PATCH) Adding CORRESPONDING to Set Operations