Configuration parameter

max_prepared_transactions — PostgreSQL Configuration Parameter

Category Memory Default 0 Unit boolean / enum / numeric Change scope Restart required

Max simultaneous two-phase-commit prepared transactions.

At a glance

Property Value
Parameter max_prepared_transactions
Category Memory
Default 0
Value type boolean / enum / numeric
Change scope Restart required

What it does

Maximum number of transactions that can be in the prepared (PREPARE TRANSACTION) state at once. 0 disables two-phase commit.

How to apply a change

Requires a full server restart (postmaster context). Set it in postgresql.conf and restart PostgreSQL.

Inspect the current value and source with SHOW max_prepared_transactions; or SELECT name, setting, unit, context, source FROM pg_settings WHERE name = 'max_prepared_transactions';.

Tuning guidance

Leave at 0 unless you use an external transaction manager (XA/2PC). Orphaned prepared transactions silently block VACUUM and bloat the database — monitor pg_prepared_xacts.

Reference

PostgreSQL documentation — Memory configuration.

Was this helpful?

← All configuration parameters