PostgreSQL

Row-level locks not visible in pg_locks during normal operation

info
configurationUpdated Feb 26, 2026
Technologies:
How to detect:

Row-level locks are stored on disk, not in memory, so they normally do not appear in pg_locks view. When a process waits for a row-level lock, it appears as waiting for the permanent transaction ID of the current holder of that row lock, not as a tuple lock.

Recommended action:

To diagnose row-level lock contention, look for processes waiting on transactionid lock type in pg_locks where granted=false. The transactionid column identifies the blocking transaction. Do not expect to see locktype='tuple' entries during normal operations - these only appear in specific edge cases. Use application-level logging or pg_stat_activity to track row-level contention patterns.