Core conceptsbeginner

Write-Ahead Log (WAL)

An append-only record of every change written before the change reaches the data files, so committed work survives a crash and can be replayed during recovery.

What this means

Before Postgres touches the actual table files, it first jots the change into an append-only logbook and makes sure that logbook reached the disk. If the server crashes a second later, it reads the logbook back and re-does anything that didn't make it into the tables. Write it down first, apply it second, that ordering is why a committed change survives a crash.

Why it matters operationally

WAL underpins durability, crash recovery, replication, and point-in-time restore, most availability decisions trace back to it.

Related errors

Where it lives in the source

src/backend/access/transam/xlog.c

← All glossary terms · GUC reference · Error catalog