autovacuum_freeze_max_age
Transaction age at which a table gets a forced anti-wraparound vacuum.
- Predeterminado
200000000- Range
- 100000 to 2000000000
- Restart needed
- Sí
- Default checked on
- PostgreSQL 18
Lo que hace
Transaction IDs are 32-bit, so old rows must be frozen before the counter wraps around. When a table's relfrozenxid gets this old, autovacuum vacuums it even if autovacuum is off, and that vacuum cannot be cancelled by lock conflicts.
Valor predeterminado
200000000. 200 million (PostgreSQL 18).
Check the current value
SHOW autovacuum_freeze_max_age; SELECT setting, unit, boot_val, context, source, pending_restart FROM pg_settings WHERE name = 'autovacuum_freeze_max_age';
Change it
ALTER SYSTEM SET autovacuum_freeze_max_age = 400000000; -- applies only after a server restart
Server restart required (pg_settings.context is postmaster). ALTER SYSTEM only stages the new value in postgresql.auto.conf.
When to change it
Some high-write systems raise it to 400-500 million to space out forced vacuums, provided normal autovacuum keeps freezing.
What can go wrong
Too high leaves less margin before the database stops accepting writes to prevent wraparound.
Questions about autovacuum_freeze_max_age
What is the default value of autovacuum_freeze_max_age in PostgreSQL?
200000000. 200 million (PostgreSQL 18).
Does changing autovacuum_freeze_max_age require a restart?
Yes. Server restart required (pg_settings.context is postmaster). ALTER SYSTEM only stages the new value in postgresql.auto.conf.
When should I change autovacuum_freeze_max_age?
Some high-write systems raise it to 400-500 million to space out forced vacuums, provided normal autovacuum keeps freezing.
Back to all PostgreSQL settings, or check the PostgreSQL manual for every option.
Check autovacuum_freeze_max_age on your own server
SQLly runs the query above against PostgreSQL and the other engines in this reference, from one desktop app on macOS, Windows and Linux.