transactionid lock type?

From: Jan de Visser <jdevisser(at)digitalfairway(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: transactionid lock type?
Date: 2008-01-18 16:44:35
Message-ID: 200801181144.35754.jdevisser@digitalfairway.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello,

I have two concurrent transactions, both heavy R/W type things. I now see that
one is backed up behind in the other, and pg_locks shows me this:

sep=# select locktype, transactionid, transaction from pg_locks where not
granted;
locktype | transactionid | transaction
---------------+---------------+-------------
transactionid | 3391481 | 3391528
(1 row)

The TFM tells me (in the description of pg_locks):

"Every transaction holds an exclusive lock on its transaction ID for its
entire duration. If one transaction finds it necessary to wait specifically
for another transaction, it does so by attempting to acquire share lock on
the other transaction ID. That will succeed only when the other transaction
terminates and releases its locks."

So what could make my transaction decide to wait for that other tx? I've
checked to see that all updates to rows shared by the two transactions are
done late in the process, but this lock happens almost immediately after the
second tx starts...

Comments?

jan

--
--------------------------------------------------------------
Jan de Visser                     jdevisser(at)digitalfairway(dot)com

                Baruk Khazad! Khazad ai-menu!
--------------------------------------------------------------

Browse pgsql-general by date

  From Date Subject
Next Message Dave Page 2008-01-18 16:47:39 Re: Forgot to dump old data before re-installing machine
Previous Message Peter Eisentraut 2008-01-18 16:37:32 Re: Forgot to dump old data before re-installing machine