Deadlocks with foreign key references - Mailing list pgsql-general

From Mike Schroepfer
Subject Deadlocks with foreign key references
Date
Msg-id A281DEDA135C2549AC42955F4C983F8612B17C@mail01.raplix.com
Whole thread Raw
Responses Re: Deadlocks with foreign key references  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
List pgsql-general
Hi Everyone,

We are getting intermittent deadlocks in our application due to foreign
key references.   We've cooked up a simple case to exercise the problem -
but I can see from previous mailing list posts that people are aware of
the issue:

http://archives.postgresql.org/pgsql-hackers/2002-03/msg01130.php

My questions are as follows:

1) Previous posts have recommended setting the constraints to INITIALLY
DEFERRED.
    a) Why does this solve the problem?
    b) Do I need to do this with every table involved?

2) Is there an alternative solution?

3) Are there any provisions in a future release (7.3?) to address this
issue.  It
seems to be a pretty severe problem that in normal operation you can get
false
deadlocks do to foreign key constrains.

Thanks for any help,

Mike

pgsql-general by date:

Previous
From: Alexandre Sebrao
Date:
Subject: Getting this error when I use createdb
Next
From: Barry Lind
Date:
Subject: timezone incompatibility