pg_walinspect
Overview
| Package | Version | Category | License | Language |
|---|---|---|---|---|
pg_walinspect | 1.1 | STAT | PostgreSQL | C |
| ID | Extension | Bin | Lib | Load | Create | Trust | Reloc | Schema |
|---|---|---|---|---|---|---|---|---|
| 6940 | pg_walinspect | No | Yes | No | Yes | No | No | - |
| Related | wal2json pgoutput test_decoding pg_logicalinspect decoderbufs wal2mongo decoder_raw pgmqtt kafka_fdw pgq |
|---|
Version
| PG18 | PG17 | PG16 | PG15 | PG14 |
|---|---|---|---|---|
| 1.1 | 1.1 | 1.1 | 1.1 | ✗ |
Install
Note: This is a built-in contrib extension of PostgreSQL
Usage
pg_walinspect provides SQL functions to inspect write-ahead log (WAL) contents on a running server. Similar to pg_waldump but accessible via SQL.
Functions
pg_get_wal_record_info(in_lsn pg_lsn) – single WAL record details:
pg_get_wal_records_info(start_lsn, end_lsn) – all records in an LSN range:
pg_get_wal_block_info(start_lsn, end_lsn, show_data) – block references from WAL records:
Returns per block reference: start_lsn, end_lsn, block_id, reltablespace, reldatabase, relfilenode, relforknumber, relblocknumber, xid, fork_flags, block_data, block_fpi_data, etc.
pg_get_wal_stats(start_lsn, end_lsn, per_record) – aggregate WAL statistics:
Tips
- Use
FFFFFFFF/FFFFFFFFasend_lsnto read up to the current server LSN - If
in_lsnis not at a record boundary, the next valid record is returned - All functions use the server’s current timeline ID
Access
Restricted to superusers and members of pg_read_server_files.
Was this page helpful?
Thanks—your feedback helps us improve this page.
What got in the way? (optional)