WAL & checkpointsAny session (SET)default on

synchronous_commit

Sets the current transaction's synchronization level.

How you change it

Any session (SET)

Defaults and ranges on this page were read from pg_settings on live PostgreSQL 18.4. Treat older majors as needing their own check before you copy a value.

What this means

Controls whether COMMIT waits for WAL to be durably flushed before returning success. 'on' guarantees durability of every acknowledged commit; 'off' lets commits return before the flush, trading a small window of possible data loss on crash for much higher throughput. With replicas, 'remote_apply'/'on' can also wait for standbys.

When it matters

Keep 'on' for financial or system-of-record data; consider 'off' or 'local' for high-throughput, loss-tolerant workloads.

Defaulton
Allowedlocal, remote_write, remote_apply, on, off
Typeenum
Change scopeAny session (SET)
CategoryWAL & checkpoints
Check the current value
SHOW synchronous_commit;

Tradeoffs

  • 'off': faster commits but a crash can lose the last fraction of a second of transactions (no corruption, just loss).
  • It can be set per-transaction, so you can relax it only for low-value writes.
  • With synchronous standbys, stricter modes wait on replica acknowledgement and raise commit latency.

Workload profiles

System of record

Leave on.

Never lose an acknowledged commit.

Bulk ingest / metrics

Consider off or local per-transaction.

Throughput over last-instant durability.

PostgreSQL manual: synchronous_commit

← All GUCs · Glossary · Runbooks