Re: Backend crash trying to delete rows

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: aaime(at)comune(dot)modena(dot)it, pgsql-bugs(at)postgresql(dot)org
Subject: Re: Backend crash trying to delete rows
Date: 2000-09-09 16:43:31
Message-ID: Pine.BSF.4.10.10009090940050.5287-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


This is a known bug. Current sources will not crash, but will
instead fail the query (since they are still referencing the name).
By 7.2, the ri triggers should probably be following the oid
of the tables and columns and will be safe from renames.

Stephan Szabo
sszabo(at)bigpanda(dot)com

On Sat, 9 Sep 2000 pgsql-bugs(at)postgresql(dot)org wrote:

> Andrea Aime (aaime(at)comune(dot)modena(dot)it) reports a bug with a severity of 3
> The lower the number the more severe it is.
>
> Short Description
> Backend crash trying to delete rows
>
> Long Description
> Platform: RedHat 6.2, PostgreSQL 7.02 compiled by gcc egcs 2.91.66,
> running on a PIII 733Mhz, 128 MB RAM, 9 GB SCSI HD.
>
> Create an empty database and then two table, a master and a slave,
> slave references master primary key with an on delete cascade
> fk option. Everything runs fine, when you delete rows in master
> table you get also corresponding slave rows deleted. Now rename
> slave into slave2 and retry delete: backend crashes.
> FK are part of table structure, you can implement them as trigger
> but they must follow any table modification, otherwise schema
> evolution is not possible.
>
> Sample Code
> I put here some code just to give you an idea, I haven't
> tried it.
>
> create table master(
> id_master serial,
> name varchar,
> primary key(id_master)
> );
>
> create table slave(
> id_slave serial,
> id_master int4,
> primary key(id_slave),
> foreign key(id_master) references master(id_master) on delete cascade
> );
>
> insert into master(name) values('Andrew');
> insert into slave(id_master,slave) values(1,'Rod');
>
> #this one works fine
> delete from master;
>
> alter table slave rename to slave2;
>
> insert into master(name) values('Andrew');
> insert into slave(id_master,slave) values(2,'Rod');
>
> #boom!
> delete from master;

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Max Pyziur 2000-09-10 18:19:08 "ORDER BY" issue - is this a bug?
Previous Message pgsql-bugs 2000-09-09 08:19:09 datestyle