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 16:29:51
Message-ID: 20030707092403.O77173-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: sfpug


On Mon, 7 Jul 2003, David Wheeler wrote:

> Does this message make any sense? Is PostgreSQL in fact implicitly
> locking tables for INSERTs, UPDATEs, and DELETEs? Or is Mark's analysis
> totally off? This seems very strange tome, since there are so many
> other high-volume applications running on PostgreSQL...

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.

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.

In response to

Responses

Browse sfpug by date

  From Date Subject
Next Message David Wheeler 2003-07-07 17:10:11 Re: Fwd: [Bricolage-Devel] DB Deadlock Detected errors
Previous Message David Wheeler 2003-07-07 16:21:59 Fwd: [Bricolage-Devel] DB Deadlock Detected errors