# wal_sync_method

> wal_sync_method — Selects the method used for forcing WAL updates to disk. Observed in PG9.0–19 Beta 3; its last measured boot default is fdatasync in PG19 Beta 3, with sighup context. This is a beta-snapshot fact and can change before PostgreSQL 19 GA.
---

> [!NOTE]
> **Fact — official short description:** “Selects the method used for forcing WAL updates to disk.”

## Identity {#identity}

| Field | Value | Meaning |
| --- | --- | --- |
| Type | `enum` | Upstream pg_settings type |
| Context | `sighup` | Takes effect after configuration reload |
| Unit | — | Raw unit |
| Range | — | Raw limits in the last observed version |
| Enum values | `fsync`, `fdatasync`, `open_sync`, `open_datasync` | — for non-enum types |
| Category | Write-Ahead Log / Settings | Upstream classification |
| Latest boot value | `fdatasync` | fdatasync |
{.fields meta="-"}

## Lifecycle {#lifecycle}

| Fact | Value |
| --- | --- |
| First observed | PG9.0 (research boundary) |
| Present in | PG9.0–19 Beta 3 |
| Removed in | No |
| Introduction commit | Not asserted: predates the PG9.0 research boundary |
| Commit date | — |
| Discussion | — |

## Default history {#default-history}

| Versions | Raw `boot_val` | Unit | Human value |
| --- | --- | --- | --- |
| PG9.0–19 Beta 3 | `fdatasync` | — | fdatasync |
{.full-width caption="Measured PG9.0–19 Beta 3 boot defaults"}

## How it works {#mechanism}

Selects the method used for forcing WAL updates to disk. A configuration reload applies a new value; existing work already in flight is not retroactively changed.

This chooses the operating-system primitive used to force WAL to durable storage, such as fdatasync, fsync, or open-sync variants. Availability and performance are platform/filesystem specific; all supported choices preserve the durability contract when the stack is honest.

Monitor and change wal_sync_method together with fsync, full_page_writes, synchronous_commit. Validate on the relevant server role and real workload, then use its sighup context to choose session change, reload, or restart; a historical boot default is not the current effective value.

## Tuning advice {#tuning-advice}

> [!TIP]
> **Advice.** These are workload-specific starting points and must be validated with measurements.

| Workload | Guidance |
| --- | --- |
| OLTP | Establish durability and recovery objectives first, then tune wal_sync_method from WAL rate, flush latency, checkpoints, and peak pg_wal usage. Validate every change with crash/recovery and archive monitoring. |
| OLAP | Provision WAL, archive bandwidth, and recovery I/O for bulk-load peaks. Coordinate load pacing and checkpoints when reducing spikes; never break the recovery chain for throughput. |
| Small nodes | Start from safe defaults or the measured Pigsty value and set explicit alerts for limited disk capacity. Do not disable durability or break the recovery chain merely to save modest I/O. |
{.full-width}

## Pigsty {#pigsty}

Values use the fixed 8-vCPU, 32-GiB, 100-GiB SSD fixture and render the current Pigsty templates for PG19 Beta 3; this does not assert current Pigsty support for that historical or beta release.

| Template | Effective value | Versus upstream boot | Source expression |
| --- | --- | --- | --- |
| OLTP | Unmodified | — | — |
| OLAP | Unmodified | — | — |
| CRIT | Unmodified | — | — |
| TINY | Unmodified | — | — |
{.full-width}

> [!CAUTION]
> **Advice — pending human review.** Fact from the current Pigsty template projection: OLTP: PG9.0–19 Beta 3 unmodified; OLAP: PG9.0–19 Beta 3 unmodified; CRIT: PG9.0–19 Beta 3 unmodified; TINY: PG9.0–19 Beta 3 unmodified. No Pigsty-specific rationale is inferred from an absent override.

## Common pitfalls {#common-pitfalls}

- Selecting a method that the operating system or filesystem does not support.
- Benchmarking on a different kernel, mount option, or storage cache than production.
- Confusing write throughput with durable-sync latency.
- Changing the method without a crash/power-loss durability test.
- Assuming the fastest method on data files is also the best method for WAL.

## Related parameters {#related-parameters}

[`fsync`](/parameters/fsync/) · [`full_page_writes`](/parameters/full-page-writes/) · [`synchronous_commit`](/parameters/synchronous-commit/) · [`wal_buffers`](/parameters/wal-buffers/) · [`wal_writer_delay`](/parameters/wal-writer-delay/) · [`commit_delay`](/parameters/commit-delay/)

## References {#references}

- [PostgreSQL 19 Beta 3 — wal_sync_method](https://www.postgresql.org/docs/19/runtime-config-wal.html#GUC-WAL-SYNC-METHOD)
- [PostgreSQL 19 release notes](https://www.postgresql.org/docs/19/release-19.html)
- [Machine-readable GUC export](/data/guc.jsonl)
