Mott Leroy <mott@acadaca.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