31016 | relation | accounts | RowExclusiveLock | t 31016 | transactionid | 139477 | ExclusiveLock | t 31016 | tuple | accounts(0,1) | ExclusiveLock | f (3 rows) --后续所有尝试更新该行的事务,都和3一样,在重量级锁 tuple lock上等待。可以通过pg_blocking_pids查看当前情况 => SELECT pid,...
"normal" locks have yet to be used. If we need to wait for a row to be released, we actually need to wait until completion of the locking transaction: all locks are released at the transaction commit or roll back. And to this end, we can request a lock on the ID of the locking ...
* Decode the locktag back to the original values, to avoid sending lots of empty bytes with every message. See lock.h to check how a locktag is defined for LOCKTAG_RELATION */ LogAccessExclusiveLock(locktag->locktag_field1, locktag->locktag_field2); } return LOCKACQUIRE_OK; } 1. ...