Re: help with locked table(s)/transactions(s)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Mott Leroy <mott(at)acadaca(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: help with locked table(s)/transactions(s)
Date: 2006-01-31 20:40:25
Message-ID: 9195.1138740025@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Mott Leroy <mott(at)acadaca(dot)com> writes:
> One thing I noticed is it seems like for every transaction lock there's
> an "ExclusiveLock" (to be expected, a lock on the transaction num) as
> well as a "ShareLock" on the same transaction which has not been granted
> the lock -- does this mean that two processes are trying to share the
> same transaction? Could this be the case?

No, the ShareLock is the means used when transaction A needs to wait for
transaction B to complete --- it tries to take a share lock on xact B's
XID, which of course is blocked as along as B is holding its
ExclusiveLock. This is used when there is a row-update conflict, ie,
A wants to lock or update a table row that B's already locked/updated.
Unfortunately, in 7.4 there isn't any easy way to find out exactly which
row transaction A is waiting on.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jim C. Nasby 2006-01-31 21:00:39 Re: FW: Schema with Postgress 8.1
Previous Message Jim C. Nasby 2006-01-31 20:23:50 Re: "xmin" system column