full_page_writes
Write a full copy of each page to WAL the first time it changes after a checkpoint.
- Par défaut
on- Range
- on, off
- Restart needed
- Non
- Default checked on
- PostgreSQL 18
Ce que cela fait
Protects against torn pages: if the OS crashes mid-write, recovery restores the whole page from WAL. It is a major source of WAL volume right after each checkpoint.
Valeur par défaut
on. on (PostgreSQL 18).
Check the current value
SHOW full_page_writes; SELECT setting, unit, boot_val, context, source, pending_restart FROM pg_settings WHERE name = 'full_page_writes';
Change it
ALTER SYSTEM SET full_page_writes = on; SELECT pg_reload_conf();
No restart: reload with SELECT pg_reload_conf() or pg_ctl reload. It cannot be changed per session (context is sighup).
When to change it
Leave it on unless the storage guarantees atomic 8kB writes (some copy-on-write file systems such as ZFS do). Reduce its cost with longer checkpoint intervals and wal_compression instead.
What can go wrong
off on storage without atomic page writes can leave unrecoverable corruption after a power loss.
Questions about full_page_writes
What is the default value of full_page_writes in PostgreSQL?
on. on (PostgreSQL 18).
Does changing full_page_writes require a restart?
No. No restart: reload with SELECT pg_reload_conf() or pg_ctl reload. It cannot be changed per session (context is sighup).
When should I change full_page_writes?
Leave it on unless the storage guarantees atomic 8kB writes (some copy-on-write file systems such as ZFS do). Reduce its cost with longer checkpoint intervals and wal_compression instead.
Back to all PostgreSQL settings, or check the PostgreSQL manual for every option.
Check full_page_writes 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.