foreign keys as arrays

From: "Alan Young" <alany(at)qwest(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: foreign keys as arrays
Date: 2000-12-20 17:45:10
Message-ID: 006801c06aac$99e7d340$d44f58cf@idiglobal.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

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}'.

Thanks.
Alan Young
Programmer/Analyst
IDIGlobal.com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Robert Dege 2000-12-20 18:02:03 Re: Odd files
Previous Message Bruce Momjian 2000-12-20 17:41:49 Re: Re: Generating HISTORY file