Re: foreign keys as arrays - Mailing list pgsql-general

From Stephan Szabo
Subject Re: foreign keys as arrays
Date
Msg-id Pine.BSF.4.21.0012201041240.82408-100000@megazone23.bigpanda.com
Whole thread Raw
In response to foreign keys as arrays  ("Alan Young" <alany@qwest.net>)
List pgsql-general
On Wed, 20 Dec 2000, Alan Young wrote:

> Is there a way I can do something like the following?

Not really this way.  We've talked about possibly at some
point allowing this as an extension to the spec on foreign
keys, but there are some behavioral things that we haven't
really figured out (what if the key isn't a single value
and you want a two dimensional array with key sets in an
array, etc...)

> create table t1 (
> t1id serial,
> );
>
> create table t2 (
> t1id int[] references t1 (t1id)
> );
>
> I know this doesn't work because I get an error message when trying to
> insert into t2.
>
> I'd like to be able allow multiple references if possible.  Has anyone found
> a way to make this work?
>
> Also, how do I update an array field?
>
> For example, t2.t1id = '{1,2,3}' and I want to add 4 to make it t2.t1id =
> '{1,2,3,4}'.


pgsql-general by date:

Previous
From: Robert Dege
Date:
Subject: Re: Odd files
Next
From: Marc SCHAEFER
Date:
Subject: Re: Re: [ADMIN] Help me for "DBI->connect failed: Sorry, too many clients already."