Re: foreign keys for array/period contains relationships

Peter Eisentraut <peter_e@gmx.net>

From: Peter Eisentraut <peter_e@gmx.net>
To: Pavel Stehule <pavel.stehule@gmail.com>
Cc: pgsql-hackers@postgresql.org
Date: 2010-10-26T17:22:17Z
Lists: pgsql-hackers
On mån, 2010-10-25 at 22:10 +0200, Pavel Stehule wrote:
> 2010/10/25 Robert Haas <robertmhaas@gmail.com>:
> >> Example #1: Foreign key side is an array, every member must match some
> >> PK.
> >>
> >> CREATE TABLE pk (a int PRIMARKY KEY, ...);
> >>
> >> CREATE TABLE fk (x int[] REFERENCES pk (a), ...);
> 
> What about optimalizations and planning?

Some work will be required to get the respective checking queries to do
the right think fast, but it's solvable in principle.