From: Csaba Nagy <nagy@ecircle-ag.com>
To: Steven Flatt <steven.flatt@gmail.com>
Cc: postgres performance list <pgsql-performance@postgresql.org>
Subject: Re: Foreign Key Deadlocking
Date: Wed, 18 Apr 2007 17:36:37 +0200
Message-ID: <1176910597.16187.75.camel@coppola.muc.ecircle.de> (raw)
In-Reply-To: <357fa7590704180807j1906d42u1f0f539ac561dc3e@mail.gmail.com>
References: <357fa7590704180807j1906d42u1f0f539ac561dc3e@mail.gmail.com>
> Can someone confirm that I've identified the right fix?
I'm pretty sure that won't help you... see:
http://archives.postgresql.org/pgsql-general/2006-12/msg00029.php
The deadlock will be there if you update/insert the child table and
update/insert the parent table in the same transaction (even if you
update some other field on the parent table than the key referenced by
the child table). If your transactions always update/insert only one of
those tables, it won't deadlock (assuming you order the inserts/updates
properly per PK).
Cheers,
Csaba.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: nagy@ecircle-ag.com, steven.flatt@gmail.com
Subject: Re: Foreign Key Deadlocking
In-Reply-To: <1176910597.16187.75.camel@coppola.muc.ecircle.de>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox