PostgreSQL

Long-running transactions hold locks and block other operations

warning
Resource ContentionUpdated Jan 21, 2026
Technologies:
How to detect:

Transactions that remain open for extended periods hold locks on affected rows and tables, preventing other transactions from acquiring needed locks and causing query queuing

Recommended action:

Keep transactions as short as possible by minimizing work between BEGIN and COMMIT. Move non-database operations outside transaction boundaries. Use appropriate isolation levels - lower isolation when possible to reduce lock scope. Monitor transaction duration