Skip site navigation (1) Skip section navigation (2)

Re: Fwd: [Bricolage-Devel] DB Deadlock Detected errors

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: David Wheeler <david(at)wheeler(dot)net>
Cc: <sfpug(at)postgresql(dot)org>
Subject: Re: Fwd: [Bricolage-Devel] DB Deadlock Detected errors
Date: 2003-07-07 17:54:03
Message-ID: (view raw, whole thread or download thread mbox)
Lists: sfpug
On Mon, 7 Jul 2003, David Wheeler wrote:

> On Monday, July 7, 2003, at 09:29  AM, Stephan Szabo wrote:
> > Updates get write locks on the particular row involved, so if you're
> > trying something like
> > T1: update foo set a=1 where key=1;
> > T2: update bar set a=2 where key=1;
> > T1: update bar set a=3 where key=1;
> > T2: update foo set a=4 where key=1;
> > you get a deadlock I believe.  It does get a shared lock on the table
> > but
> > that shouldn't affect anything.
> Okay, row-level locks I can handle. :-)
> > Another possibility would be foreign keys since those grab explicit row
> > locks on the matching rows of the other relation.  It's possible that
> > Jan's patch for updates might help in that case.
> I'm not familiar with what's happening with PG dev. Is "Jan's patch"
> part of 7.4?

Yeah, although I believe he send a 7.3 version to -general as well.  It
gets rid of locking of the associated primary key row when doing an update
on a foreign key row that doesn't change the key value.

In response to


sfpug by date

Next:From: David WheelerDate: 2003-07-07 19:47:44
Subject: Re: Fwd: [Bricolage-Devel] DB Deadlock Detected errors
Previous:From: David WheelerDate: 2003-07-07 17:10:11
Subject: Re: Fwd: [Bricolage-Devel] DB Deadlock Detected errors

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group