BUG #2138: Feature request: handle foreign key constraints on arrays

From: "Bernhard Rosenkraenzer" <bero(at)arklinux(dot)org>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #2138: Feature request: handle foreign key constraints on arrays
Date: 2006-01-02 19:29:44
Message-ID: 20060102192944.E5492F0AC6@svr2.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


The following bug has been logged online:

Bug reference: 2138
Logged by: Bernhard Rosenkraenzer
Email address: bero(at)arklinux(dot)org
PostgreSQL version: 8.1.1
Operating system: Linux (Ark Linux 2005.2)
Description: Feature request: handle foreign key constraints on
arrays
Details:

Best illustrated by an example:

A company has several offices and some employees who work in office #1 some
of the time, and in office #2 at a different time.

It would be nice to represent them in the database like this:
CREATE TABLE offices(id SERIAL8 UNIQUE PRIMARY KEY, street VARCHAR(128));
CREATE TABLE employees(id SERIAL8 UNIQUE PRIMARY KEY, name VARCHAR(128),
workplace BIGINT[] REFERENCES offices(id) ON UPDATE CASCADE);

Currently postgres refuses to do this because BIGINT[] and BIGINT are
different types, it would be nice to simply apply the constraint to all
entries in the array if a constraint for type X is applied to X[].

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Joe Conway 2006-01-03 02:34:23 Re: [BUGS] BUG #2129: dblink problem
Previous Message Magnus Hagander 2006-01-01 12:10:13 Re: BUG #2133: can't reinstall postgresql