configuration limit exceeded
SQLSTATE 53400 is raised when a configured resource limit is exceeded — for example, exceeding the maximum number of locks, shared memory segments, or other configurable resource caps.
- 1Exceeding max_locks_per_transaction (the maximum number of locks one transaction can hold)
- 2Exceeding other configurable resource limits defined in postgresql.conf
Transaction holding more locks than max_locks_per_transaction allows.
-- A transaction that acquires locks on tens of thousands of objects: BEGIN; -- LOCK many tables...
expected output
ERROR: out of shared memory HINT: You might need to increase max_locks_per_transaction.
Fix 1
Increase max_locks_per_transaction in postgresql.conf
WHEN When a legitimate use case requires many locks.
-- In postgresql.conf: -- max_locks_per_transaction = 256 (default is 64)
Why this works
max_locks_per_transaction controls the shared lock table size. Increasing it requires a server restart.
Fix 2
Reduce the number of objects locked per transaction
WHEN When the lock count can be reduced by redesigning the operation.
Why this works
Break large operations into smaller transactions that lock fewer objects at a time.
Class 53 — Insufficient Resources
Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev