Re: Foreign keys on array elements - Mailing list pgsql-hackers

From Stephan Szabo
Subject Re: Foreign keys on array elements
Date
Msg-id 20050420071721.P42111@megazone.bigpanda.com
Whole thread Raw
In response to Foreign keys on array elements  (Christopher Kings-Lynne <chriskl@familyhealth.com.au>)
Responses Re: Foreign keys on array elements  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Wed, 20 Apr 2005, Christopher Kings-Lynne wrote:

> Hi,
>
> Can you put a foreign key constraint on an array column that says that
> each element of the array must match a primary key?

Not currently, because foreign keys are between directly comparable
things.

> If not, is this a TODO perhaps?

Maybe. It's been discussed before IIRC.  Doing the referential actions
might get tricky, and you'd often want to index so that finding the
individual array elements isn't expensive.


pgsql-hackers by date:

Previous
From: "Marc G. Fournier"
Date:
Subject: HAVING ...
Next
From: Tom Lane
Date:
Subject: Re: HAVING ...