Re: foreign keys for array/period contains relationships

Поиск
Список
Период
Сортировка
От Jeff Davis
Тема Re: foreign keys for array/period contains relationships
Дата
Msg-id 1288053482.11412.13.camel@jdavis-ux.asterdata.local
обсуждение исходный текст
Ответ на foreign keys for array/period contains relationships  (Peter Eisentraut <peter_e@gmx.net>)
Ответы Re: foreign keys for array/period contains relationships  (Peter Eisentraut <peter_e@gmx.net>)
Список pgsql-hackers
On Mon, 2010-10-25 at 22:11 +0300, Peter Eisentraut wrote:
> Currently, foreign keys only work with the = operator (the name might be
> different, but it needs to behave like equality).  I'm thinking there
> are other scenarios that could be useful, for example with arrays and
> range types.

I agree completely. I had not previously considered that arrays could
benefit from this idea as well as range types. Mentally, I had already
been calling them "foreign range keys" ;)

> 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?

> Is this sort of thing feasible?  Has anyone done more research into the
> necessary details?

Yes, I think so. #3 and #4 are very feasible. #1 and #2 are, as well,
unless I'm missing something.

Regards,Jeff Davis



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Jeff Davis
Дата:
Сообщение: Re: foreign keys for array/period contains relationships
Следующее
От: Robert Haas
Дата:
Сообщение: Re: Range Types, discrete and/or continuous