Re: Bug #539: Unexpected DeadLock on REFERENCES

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: <elf(at)solvo(dot)ru>, <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: Bug #539: Unexpected DeadLock on REFERENCES
Date: 2001-12-14 14:50:42
Message-ID: 20011214064658.H11758-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


On Fri, 14 Dec 2001 pgsql-bugs(at)postgresql(dot)org wrote:

> 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 ?

I get a detected deadlock. This is a known problem due to the
foreign key locks being stronger than necessary. I think
a shared row lock that blocks update/delete but not itself rather
than the current select for update lock would allow this case
to work.

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2001-12-14 16:06:54 Re: Unable to compare _bpchar for similarity in WHERE-clause (MINOR A NNOYANCE)
Previous Message Lamar Owen 2001-12-14 14:04:45 Re: Red Hat 7.2 Bug