Re: Arrays and foreign keys - Mailing list pgsql-hackers

From Chris
Subject Re: Arrays and foreign keys
Date
Msg-id 39E5C32A.99854A88@bitmead.com
Whole thread Raw
In response to Re: Arrays and foreign keys  (Bruce Momjian <pgman@candle.pha.pa.us>)
Responses Re: Arrays and foreign keys  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
List pgsql-hackers
There is some stuff which last time I looked is in contrib that allows
queries to test if something is in an array. Something vaguely like
SELECT * from part, box where IN(part.num, box.array).

Having this integrated in the foreign key stuff would certainly be
important for object databases, which by definition use these kinds of
arrays.

Bruce Momjian wrote:
> 
> > > Well, the two types aren't the same (one is an integer the
> > > other an integer array,) so I wouldn't expect it to work. Note:
> >
> > Eh, I could figure that out myself. What I'm asking for is if there is a way to
> > combine arrays with foreign keys?
> >
> > I believe the answer for now is 'no', but did like to get it confirmed, and
> > also draw attention to this if someone wants to make it.
> >
> > > * Make sure that types used in foreign key constraints
> > >   are comparable.
> >
> > And maybe
> > * Add foreign key constraint for arrays
> 
> Added to TODO.
> 
> --
>   Bruce Momjian                        |  http://candle.pha.pa.us
>   pgman@candle.pha.pa.us               |  (610) 853-3000
>   +  If your life is a hard drive,     |  830 Blythe Avenue
>   +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026


pgsql-hackers by date:

Previous
From: Zeugswetter Andreas SB
Date:
Subject: AW: ALTER TABLE DROP COLUMN
Next
From: Zeugswetter Andreas SB
Date:
Subject: AW: AW: Reimplementing permission checks for rules