Re: foreign keys for array/period contains relationships - Mailing list pgsql-hackers

From Jeff Davis
Subject Re: foreign keys for array/period contains relationships
Date
Msg-id 1288119207.15279.24.camel@jdavis-ux.asterdata.local
Whole thread Raw
In response to Re: foreign keys for array/period contains relationships  (Peter Eisentraut <peter_e@gmx.net>)
Responses Re: foreign keys for array/period contains relationships
List pgsql-hackers
On Tue, 2010-10-26 at 20:25 +0300, Peter Eisentraut wrote:
> Let's say you have
> 
> PK
> 
> 1
> 2
> 3
> 4
> 5
> 
> FK
> 
> [1,2,3]
> [3,4,5]
> [4,4,4]
> 
> When you delete PK = 3, what do you  expect to happen?  OK, you might
> decide to delete the first two rows from the FK table.  This might or
> might not make sense in a particular case, but on delete cascade is an
> option the user has to choose explicitly.

That's what I would expect.

> But I don't see what to do
> about cascading an update when you, say, update PK 1 => 6.

Intuitively, I would expect all 1's to be replaced by 6's in all arrays.
But I can now see why you would be hesitant to try to support that.

Regards,Jeff Davis



pgsql-hackers by date:

Previous
From: Dean Rasheed
Date:
Subject: Re: add label to enum syntax
Next
From: Jeff Davis
Date:
Subject: Re: foreign keys for array/period contains relationships