Bug in FOREIGN KEY

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: PostgreSQL-development <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Bug in FOREIGN KEY
Date: 2000-12-12 17:13:34
Message-ID: 200012121713.MAA14926@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

This problem with foreign keys has been reported to me, and I have confirmed
the bug exists in current sources. The DELETE should succeed:

---------------------------------------------------------------------------

CREATE TABLE primarytest2 (
col1 INTEGER,
col2 INTEGER,
PRIMARY KEY(col1, col2)
);

CREATE TABLE foreigntest2 (col3 INTEGER,
col4 INTEGER,
FOREIGN KEY (col3, col4) REFERENCES primarytest2
);
test=> BEGIN;
BEGIN
test=> INSERT INTO primarytest2 VALUES (5,5);
INSERT 27618 1
test=> DELETE FROM primarytest2 WHERE col1 = 5 AND col2 = 5;
ERROR: triggered data change violation on relation "primarytest2"


--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2000-12-12 17:14:07 Re: shared libs on sco how?
Previous Message Chris Jones 2000-12-12 17:00:49 Re: No postgres on Solaris