Arrays and foreign keys

From: Kaare Rasmussen <kar(at)webline(dot)dk>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Arrays and foreign keys
Date: 2000-08-08 20:03:11
Message-ID: 00080822074400.00770@bering
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Seems that it's not possible to combine arrays and foreign keys ?

CREATE TABLE table1 (
fld1 integer NOT NULL,
number integer,
level integer,
PRIMARY KEY (fld1)
);

CREATE TABLE table2 (
pkey integer NOT NULL,
arvar integer[],
PRIMARY KEY (pkey),
FOREIGN KEY (arvar) REFERENCES table1(fld1)
);

This works, but the following insert complains that

ERROR: Unable to identify an operator '=' for types 'int4' and '_int4'
You will have to retype this query using an explicit cast

--
Kaare Rasmussen --Linux, spil,-- Tlf: 3816 2582
Kaki Data tshirts, merchandize Fax: 3816 2582
Howitzvej 75 ben 14.00-18.00 Email: kar(at)webline(dot)dk
2000 Frederiksberg Lrdag 11.00-17.00 Web: www.suse.dk

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message G. Anthony Reina 2000-08-08 22:49:49 Re: Extending to 32K row limit
Previous Message Stephan Szabo 2000-08-08 18:51:51 Re: Constraint stuff (fwd)