Re: Deadlock bug - Mailing list pgsql-hackers

From Kevin Grittner
Subject Re: Deadlock bug
Date
Msg-id 4C6E4AEE0200002500034972@gw.wicourts.gov
Whole thread Raw
In response to Re: Deadlock bug  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Deadlock bug
List pgsql-hackers
Tom Lane <tgl@sss.pgh.pa.us> wrote:
> You didn't tell us exactly what the FK relationship is
The original post has an attachment with a self-contained example,
starting with table creation.
> I suspect the reason for the deadlock is that one process is
> trying to update a row that references some row already updated by
> the other.
The surprising thing is that a particular row is (using the
identifiers from the attachment):
Process 2 updates a particular row without blocking.
Process 1 updates the same row, which blocks.
Process 2 updates the same row again (with *exactly* the same UPDATE
statement), which fails with a deadlock.
I'm not sure I consider that a bug, but it moves the needle on the
astonishment meter.
-Kevin


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Interruptible sleeps (was Re: CommitFest 2009-07: Yay, Kevin! Thanks, reviewers!)
Next
From: Robert Haas
Date:
Subject: Re: small smgrcreate cleanup patch