Foreign Key bug -- 7.4b4

From: Rod Taylor <rbt(at)rbt(dot)ca>
To: PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Foreign Key bug -- 7.4b4
Date: 2003-10-10 21:34:53
Message-ID: 1065821692.60436.2.camel@jester
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

May have posted this earlier...

It would seem that caching the plans for foreign keys has some unwanted
side effects.

test=# select version();
version
------------------------------------------------------------------------
PostgreSQL 7.4beta4 on i386-portbld-freebsd4.8, compiled by GCC 2.95.4
(1 row)

test=#
test=# create table a (col integer primary key);
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "a_pkey"
for table "a"
CREATE TABLE
test=#
test=# create table b (col integer primary key references a on update
cascade on delete cascade);
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "b_pkey"
for table "b"
CREATE TABLE
test=#
test=#
test=# insert into a values (1);
INSERT 687978 1
test=# insert into b values (1);
INSERT 687979 1
test=#
test=# insert into a values (2);
INSERT 687980 1
test=# insert into b values (2);
INSERT 687981 1
test=#
test=# delete from a where col = 1;
DELETE 1
test=#
test=# alter table b drop constraint b_pkey;
ALTER TABLE
test=#
test=# delete from a where col = 2;
ERROR: could not open relation with OID 687972

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dann Corbit 2003-10-10 22:28:05 Re: 2-phase commit
Previous Message Manfred Spraul 2003-10-10 20:39:34 Re: compile warning