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

From Peter Eisentraut
Subject Re: foreign keys for array/period contains relationships
Date
Msg-id 1288113924.22800.4.camel@vanquo.pezone.net
Whole thread Raw
In response to Re: foreign keys for array/period contains relationships  (Jeff Davis <pgsql@j-davis.com>)
Responses Re: foreign keys for array/period contains relationships
List pgsql-hackers
On mån, 2010-10-25 at 17:38 -0700, Jeff Davis wrote:
> > Implementing the foreign key side of this merely requires the system
> to
> > have some knowledge of the required "contains" operator, which it
> does
> > in the array case, and something can surely be arranged for the
> range
> > case.  The problem is you can't do cascading updates or deletes, but
> you
> > could do on update/delete restrict, which is still useful.
> 
> Why can't you do cascading updates/deletes?

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.  But I don't see what to do
about cascading an update when you, say, update PK 1 => 6.




pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: foreign keys for array/period contains relationships
Next
From: Jeff Davis
Date:
Subject: Re: Range Types, discrete and/or continuous