Method used for forcing WAL updates out to disk.
At a glance
| Property | Value |
|---|---|
| Parameter | wal_sync_method |
| Category | Write Ahead Log |
| Default | (see documentation) |
| Value type | enum |
| Change scope | Per-session (SET) |
| Available in | PostgreSQL 12, 13, 14, 15, 16, 17, 18, 19 (added in 12) |
What it does
Method used for forcing WAL updates out to disk. If fsync is off then this setting is irrelevant, since WAL file updates will not be forced out at all. Possible values are:
open_datasync (write WAL files with open() option O_DSYNC)
(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 wal_sync_method; or SELECT name, setting, unit, context, source FROM pg_settings WHERE name = 'wal_sync_method';.
Tuning guidance
Leave the platform default; only change it if benchmarking shows a faster, still-safe fsync primitive on your kernel/storage. Never pick a method that does not actually flush to stable storage.