Re: "deadlock detected" documentation

From: Matt Mello <alien(at)spaceship(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: "deadlock detected" documentation
Date: 2003-05-15 16:37:13
Message-ID: 3EC3C239.7070708@spaceship.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Tom Lane wrote:
> I can't see a reason for bare UPDATEs of that sort to get deadlocks.
> There must be some other factor involved. Do you have triggers, rules,
> or foreign keys on this table? Other locks being taken in the same
> transaction?

We haven't finished implementing our transaction system yet, so no,
there are no other things running in the txn. Each of those statements
is a complete txn. <blush>

This problem only happens on our production server (Murphy's Law). I
haven't been able to duplicate it on our test system. The production
system is a heavily multi-threaded environment that has lots of data
entering the system all the time. This makes it difficult to detect
which SQL statements are affecting each other. :(

There are no triggers or rules except for the foreign keys.

The txn table has several foreign keys. The two that seem to be of
interest are:
txn.drawerid -> drawer.drawerid
txn.batchid -> batch.batchid

I certainly don't mind posting a LOT more info on this. I just didn't
want to spam the list with useless information. If I understood more
about what can cause this kind of error, I could probably find and post
the pertinent info. Can I assume that a plain old select has nothing to
do with this? If so, I can remove the select's from my log and that
will eliminate about 80% of the SQL, making it easier to tell what is
happening.

Thanks, Tom!

--
Matt Mello

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Ian Barwick 2003-05-15 16:41:42 Re: Inquiry From Form [pgsql]
Previous Message Bruce Momjian 2003-05-15 16:33:50 Re: SQL Parser