Deadlocks with foreign key references

From: Mike Schroepfer <mike(at)centerrun(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Deadlocks with foreign key references
Date: 2002-06-21 16:29:51
Message-ID: A281DEDA135C2549AC42955F4C983F8612B17C@mail01.raplix.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Shaun Thomas 2002-06-21 16:33:09 Re: db grows and grows
Previous Message Barry Lind 2002-06-21 16:19:21 timezone incompatibility