53400
PostgreSQLERRORNotableInsufficient ResourcesHIGH confidence

configuration limit exceeded

What this means

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.

Why it happens
  1. 1Exceeding max_locks_per_transaction (the maximum number of locks one transaction can hold)
  2. 2Exceeding other configurable resource limits defined in postgresql.conf
How to reproduce

Transaction holding more locks than max_locks_per_transaction allows.

trigger — this will error
trigger — this will error
-- 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.

Increase max_locks_per_transaction in postgresql.conf
-- 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.

Sources
Official documentation ↗

Class 53 — Insufficient Resources

Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev

← All PostgreSQL errors