Specifies the maximum age (in transactions) that a table’s pg_class.relfrozenxid field can attain before VACUUM takes extraordinary measures to avoid system-wide transaction ID wraparound failure.
At a glance
| Property | Value |
|---|---|
| Parameter | vacuum_failsafe_age |
| Category | Vacuuming |
| Default | 1600000000 |
| Value type | integer |
| Change scope | Per-session (SET) |
| Available in | PostgreSQL 14, 15, 16, 17, 18, 19 (added in 14) |
What it does
Specifies the maximum age (in transactions) that a table’s pg_class.relfrozenxid field can attain before VACUUM takes extraordinary measures to avoid system-wide transaction ID wraparound failure. This is VACUUM’s strategy of last resort. The failsafe typically triggers when an autovacuum to prevent transaction ID wraparound has already been running for some time, though it’s possible for the failsafe to trigger during any VACUUM.
When the failsafe is triggered, any cost-based delay that is in effect will no longer be applied, further non-essential maintenance tasks (such as index vacuuming) are bypassed, and any Buffer Access Strategy in use will be disabled resulting in VACUUM being free to make use of all of shared buffers .
(Description quoted from the official PostgreSQL documentation.)
How to apply a change
Can be set per session with SET, per role/database with ALTER ROLE/DATABASE ... SET, or globally in postgresql.conf.
Inspect the current value and source with SHOW vacuum_failsafe_age; or SELECT name, setting, unit, context, source FROM pg_settings WHERE name = 'vacuum_failsafe_age';.
Tuning guidance
The emergency brake: when table age crosses it, vacuum drops cost-delays and skips index cleanup to outrun wraparound. Leave it near default; lowering it makes the failsafe trigger sooner on at-risk clusters.