Re: Foreign Key bug -- 7.4b4

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Rod Taylor <rbt(at)rbt(dot)ca>
Cc: PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Foreign Key bug -- 7.4b4
Date: 2003-10-24 04:26:37
Message-ID: 200310240426.h9O4QbD06521@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


I can confirm this bug in CVS.

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

Rod Taylor wrote:
-- Start of PGP signed section.
> 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
>
-- End of PGP section, PGP failed!

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Curt Sampson 2003-10-24 04:29:59 Re: Broken Constraint Checking in Functions
Previous Message Bruce Momjian 2003-10-24 04:09:17 Re: 7.4 compatibility question