ERROR: out of shared memory — HINT: You might need to increase max_locks_per_transaction.
A transaction took more locks than the lock table can hold — usually touching many tables/partitions at once.
Seen on:
PostgreSQL
Meaning
Each table/partition/index accessed takes a lock. Large partitioned tables, pg_dump of many tables, or dropping many objects in one transaction exhaust max_locks_per_transaction.
Common causes
- Queries over many partitions
- pg_dump/pg_restore of thousands of tables
- Bulk DDL in one transaction
⚡ Quick fix
- Increase max_locks_per_transaction (restart required)
- Split work into smaller transactions
- Reduce partitions touched per query
Detailed fix by platform
PostgreSQL
ALTER SYSTEM SET max_locks_per_transaction = 256; -- then restart
How to diagnose
- Scope — How many tables/partitions involved?
- Recent change — Did it start after a deploy, upgrade, or configuration change? Compare with the last working version.
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
Was this page helpful?
Report a correction or suggest an improvement
Last updated 2 Oct 2026