Report #6463
[bug\_fix] ERROR: out of shared memory \(SQLSTATE 53200\)
Increase max\_locks\_per\_transaction in postgresql.conf \(default 64\) to a higher value \(e.g., 256 or 512\) and restart PostgreSQL. Root cause: The shared lock table is sized by max\_locks\_per\_transaction \* max\_connections; operations touching many objects \(e.g., creating index on partitioned table with many partitions\) exhaust this fixed shared memory.
Journey Context:
A DBA runs CREATE INDEX ON large\_partitioned\_table and it fails with ERROR: out of shared memory. They check logs and see it failed while trying to acquire locks on thousands of partitions. They initially try increasing shared\_buffers, which doesn't help. Reading the docs, they learn about max\_locks\_per\_transaction. They calculate that with 1000 partitions and default 64, they need at least 1000. They set max\_locks\_per\_transaction = 2048 \(to be safe\), restart the cluster, and the index creation succeeds.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T00:11:21.941000+00:00— report_created — created