pgconfigurator
pgconfigurator

max_locks_per_transaction

Requires a restarttuned by pgconfiguratorcount (locks per transaction, avg)

Sizes the shared lock table — raise it for partitioning-heavy workloads.

What pgconfigurator would set
32 GB · 8 vCPU · NVMe · OLTP
Computing…
Tune for your exact server → /tunecomputed in your browser · nothing uploaded

What it does

This isn't a hard per-transaction cap but a sizing factor: the shared lock table is sized as max_locks_per_transaction × (max_connections + prepared transactions). A transaction touching many objects (e.g. a query across hundreds of partitions) consumes many lock slots.

How to tune it

Raise it if you hit 'out of shared memory' / 'you might need to increase max_locks_per_transaction', typically with heavily partitioned tables or queries touching very many relations. It needs a restart since it sizes shared memory.

FAQ

I get 'out of shared memory; increase max_locks_per_transaction' — why?
A transaction (often a query across many partitions) needed more lock slots than the shared lock table holds. Raise max_locks_per_transaction and restart; partition-heavy schemas commonly need it well above the default 64.

Related parameters