pg_walinspect
pg_walinspect : functions to inspect contents of PostgreSQL Write-Ahead Log
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 6940 | pg_walinspect | pg_walinspect | 1.1 |
STAT | PostgreSQL | C |
| Attribute | Has Binary | Has Library | Need Load | Has DDL | Relocatable | Trusted |
|---|---|---|---|---|---|---|
| --s-d-- | No | Yes | No | Yes | no | no |
| Relationships | |
|---|---|
| See Also | wal2json pgoutput test_decoding pg_logicalinspect decoderbufs wal2mongo decoder_raw pgmqtt kafka_fdw pgq |
Packages
| PG18 | PG17 | PG16 | PG15 | PG14 |
|---|---|---|---|---|
| 1.1 | 1.1 | 1.1 | 1.1 | N/A |
Install
Create this extension with:
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.