WAL & recovery

WAL record (XLogRecord)

Also called: xlog record, redo record, XLogRecord

A WAL record is one entry in the write-ahead log describing a single change PostgreSQL is about to make. It starts with a fixed XLogRecord header (total length, transaction id, a link to the previous record's LSN, a resource-manager id, and a CRC checksum), followed by which pages it touches and the change payload itself.

What this means

One entry in the write-ahead log describing a single change Postgres is about to make. It opens with a fixed header (total length, the transaction id, a link back to the previous record, which subsystem it belongs to, and a checksum), then lists the pages it touches and the change itself.

Why it matters operationally

WAL records are the unit of durability and replication: they are written before the data pages they describe, replayed to recover after a crash, and streamed to replicas. The CRC catches corruption on replay, and the previous-LSN link chains the whole log into a verifiable sequence.

Related & next

Anatomy of a WAL recordResource manager, who replays each recordLSN, the address of a WAL record

← All glossary terms · GUC reference · Error catalog