walreader
walreader · SQL functions for reading and inspecting PostgreSQL WAL records.
Overview
Usage
Sources:
walreader exposes PostgreSQL WAL record headers and resource-manager descriptions through SQL. It is an educational implementation modeled on pg_waldump; upstream recommends the standard tool as lighter and more capable.
walreader.default_wal_directory can point a session at another server directory, and functions can read by segment name or LSN. WAL contains sensitive operational and data-change information. Revoke all access from PUBLIC, restrict use to a dedicated superuser diagnostic role, and do not accept caller-controlled paths.
WAL formats and internal decoders are major-version-specific. Never parse segments with a mismatched binary. Reading an active final record can legitimately report an incomplete record. Set strict record and statement limits, copy archived segments for analysis where possible, and test corrupted/truncated input without risking the primary. Prefer pg_waldump outside the server process to isolate crashes and resource use.