When COMMIT waits for WAL durability / standby confirmation.
At a glance
| Property | Value |
|---|---|
| Parameter | synchronous_commit |
| Category | WAL |
| Default | on |
| Value type | boolean / enum / numeric |
| Change scope | Per-session (SET) |
What it does
Controls whether a transaction commit waits for its WAL tuple/" title="Tuple">record to be flushed to disk (and, with synchronous standbys, confirmed remotely) before returning success. Options include on, remote_apply, remote_write, local, and off.
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 synchronous_commit; or SELECT name, setting, unit, context, source FROM pg_settings WHERE name = 'synchronous_commit';.
Tuning guidance
Per-transaction tuning is powerful: set off or local for non-critical, high-volume writes to cut commit latency (risking the last few ms of transactions on crash), while keeping on for money/critical paths. With sync standbys, remote_apply gives read-your-writes on replicas at higher latency.