Re: Foreign keys on array elements

From: Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com>
To: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>
Cc: Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Foreign keys on array elements
Date: 2005-04-20 14:26:18
Message-ID: 20050420071721.P42111@megazone.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2005-04-20 14:32:19 Re: HAVING <alias> ...
Previous Message Marc G. Fournier 2005-04-20 14:23:02 HAVING <alias> ...