Skip site navigation (1) Skip section navigation (2)

Re: Bug #514: Backend crashes periodically

From: Hiroshi Inoue <Inoue(at)tpf(dot)co(dot)jp>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Warren Volz <wrv(at)po(dot)cwru(dot)edu>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: Bug #514: Backend crashes periodically
Date: 2001-11-13 00:23:55
Message-ID: 3BF0681B.8B2DFC7E@tpf.co.jp (view raw or flat)
Thread:
Lists: pgsql-bugs
Tom Lane wrote:
> 
> Okay, I've extracted a reproducible test case from Warren's info:
> 
> Setup:
> 
> CREATE TABLE sis_user (
> sis_user_id             INTEGER PRIMARY KEY,
> last_visit              DATETIME NOT NULL DEFAULT TEXT 'now');
> 
> CREATE TABLE session (
> session_key             CHAR(40) PRIMARY KEY,
> sis_user_id             INTEGER NOT NULL REFERENCES sis_user(sis_user_id),
> last_access_time        DATETIME NOT NULL DEFAULT TEXT 'now');
> 
> CREATE RULE session_del AS ON DELETE TO session DO
> UPDATE sis_user SET last_visit = OLD.last_access_time
> WHERE OLD.sis_user_id = sis_user.sis_user_id;
> 
> insert into sis_user values(1);
> 
> In session 1, do:
> 
> insert into session values('zzz', 1);
> begin;
> delete from session where  session_key  = 'zzz';
> 
> In session 2, do:
> 
> delete from session where  session_key  = 'zzz';
> 
> Back to session 1:
> 
> end;

Thanks for your quick fix as usual.
BTW I have a question about this example.
Session 2 deletes no row because *session 1* already
deleted the rows but the session_del rule seems to
be invoked. Is it a right behavior ?

regards,
Hiroshi Inoue

In response to

Responses

pgsql-bugs by date

Next:From: Tom LaneDate: 2001-11-13 00:26:01
Subject: Re: Bug #514: Backend crashes periodically
Previous:From: Doran L. BartonDate: 2001-11-12 19:06:56
Subject: 7.1.3 w/ Perl/DBI application hangs

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group