Re: Is this a bug, or is it just me?

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: Josh Berkus <josh(at)agliodbs(dot)com>
Cc: sqllist <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Is this a bug, or is it just me?
Date: 2001-02-07 17:21:12
Message-ID: Pine.BSF.4.21.0102070917140.49683-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql


Technically you are not allowed to make an FK to non-unique
values. What you're closer to looking for is MATCH PARTIAL
which we don't support (because it's a real pain - although
with the new memory management stuff in 7.1 it may be less
of one - since the fundamental problem is storing values
from other iterations of the trigger for this last update/delete
for ref actions).

7.1 won't let you define such a constraint with the create
table or alter table syntaxes (I guess theoretically it would
let you create constraint trigger and bring the broken
constraint from an older version). Right now we don't
support constraining views because we don't have a mechanism
in place to rewrite the constraint to actually work.

On Tue, 6 Feb 2001, Josh Berkus wrote:

> Tom et al.
>
> Discovered this quirk in foriegn keys:
>
> In the preliminary version of a database, I added foriegn
> key constraints to a number of tables, linking them to a
> column in a shared reference table (status.status) that was
> only one-half of a composite primary key (and thus the
> values were not unique). When I tried to delete a row
> containing a "2" in the status column from the status
> relation, I received a Foreign Key violation error event
> though there were other "2"'s in the table still present.
>
> So ... is this a bug in forign key implementation, or just
> my fault for keying off a non-unique value?
>
> And, if the latter, is there a way I can construct a foreign
> key constraint that keys onto a view or query?

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Brice Ruth 2001-02-07 17:23:37 Re: Re: [SQL] Re: SQL Join - MySQL/PostgreSQL difference?
Previous Message Brett W. McCoy 2001-02-07 16:58:48 Re: Re: [SQL] Re: SQL Join - MySQL/PostgreSQL difference?