WAL & recovery

pg_walinspect

Also called: WAL inspection extension, pg_get_wal_stats

pg_walinspect is a contrib extension (PostgreSQL 15+) that lets you decode the write-ahead log from inside SQL. pg_get_wal_records_info() lists individual records between two LSNs, and pg_get_wal_stats() summarizes them per resource manager, counts, record bytes, and full-page-image bytes. It is the in-database equivalent of the command-line pg_waldump.

What this means

A built-in extension (PG15+) for reading the write-ahead log from plain SQL. One function lists the individual records between two log positions; another summarizes them per subsystem, how many records, how many bytes, how much was full-page images. It does pg_waldump's job, but from inside a query.

Why it matters operationally

It turns WAL volume from a mystery into something measurable. You can see exactly which subsystem (heap, btree, etc.) is generating WAL and how much of it is full-page images versus real changes, the key to deciding whether to space out checkpoints, enable compression, or fix a write pattern.

← All glossary terms · GUC reference · Error catalog