Bug #539: Unexpected DeadLock on REFERENCES

From: pgsql-bugs(at)postgresql(dot)org
To: pgsql-bugs(at)postgresql(dot)org
Subject: Bug #539: Unexpected DeadLock on REFERENCES
Date: 2001-12-14 10:00:44
Message-ID: 200112141000.fBEA0iu72479@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Eugene Fokin (elf(at)solvo(dot)ru) reports a bug with a severity of 2
The lower the number the more severe it is.

Short Description
Unexpected DeadLock on REFERENCES

Long Description
DeadLock happens when we're trying to concurrent update different
tables which chained with one table through REFERENCE.
See Example Code. Just perform the script and follow instructions
on the header.
This case have been checked on 7.1.3 version.

Sample Code
--
-- At first you should execute this script.
-- In two different sessions for one DB perform:
-- (1) begin transaction;
-- (2) begin transaction;
-- (1) update ref1 set d='R11110';
-- (2) update ref2 set d='R22220';
-- (1) update ref3 set d='R33330';
-- (2) update ref4 set d='R44440';
-- !!! Didn't you get DeadLock ?
--

create table prim(
a1 char(1) default '1' unique,
a2 char(1) default '2' unique,
a3 char(1) default '3' unique
);

create table ref1(
t1 char(1) references prim(a1),
t3 char(1) references prim(a3),
d varchar(10)
);

create table ref2(
t2 char(1) references prim(a2),
d varchar(10)
);

create table ref3(
t1 char(1) references prim(a1),
t2 char(1) references prim(a2),
d varchar(10)
);

create table ref4(
t1 char(1) references prim(a1),
t3 char(1) references prim(a3),
d varchar(10)
);

insert into prim (a1,a2,a3) values ('1','2','3');
insert into prim (a1,a2,a3) values ('4','5','6');

insert into ref1(t1,t3,d)values('1','3','R111');
insert into ref2(t2,d)values('5','R222');
insert into ref3(t1,t2,d)values('4','5','R333');
insert into ref4(t1,t3,d)values('1','3','R111');

No file was uploaded with this report

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Lamar Owen 2001-12-14 14:04:45 Re: Red Hat 7.2 Bug
Previous Message pgsql-bugs 2001-12-14 09:43:18 Bug #538: Backend crasches