RefLib

Reference library for AI

Back

postgresql_16:9.6.37 pg_walinspect — low-level WAL inspection

PostgreSQL 16 > Appendixes > Additional Supplied Modules and Extensions > pg_walinspect — low-level WAL inspection

The pg_walinspect module provides SQL functions that allow you to inspect the contents of write-ahead log of a running PostgreSQL database cluster at a low level, which is useful for debugging, analytical, reporting or educational purposes. It is similar to (see postgresql_16:7.3.11), but accessible through SQL rather than a separate utility.

All the functions of this module will provide the WAL information using the server's current timeline ID.

Note

The pg_walinspect functions are often called using an LSN argument that specifies the location at which a known WAL record of interest *begins*. However, some functions, such as pg_logical_emit_message (see pg-logical-emit-message), return the LSN *after* the record that was just inserted.

Tip

All of the pg_walinspect functions that show information about records that fall within a certain LSN range are permissive about accepting *end_lsn* arguments that are after the server's current LSN. Using an *end_lsn* “from the future” will not raise an error.

>

It may be convenient to provide the value FFFFFFFF/FFFFFFFF (the maximum valid pg_lsn value) as an *end_lsn* argument. This is equivalent to providing an *end_lsn* argument matching the server's current LSN.

By default, use of these functions is restricted to superusers and members of the pg_read_server_files role. Access may be granted by superusers to others using GRANT.

Subsections

Back