select open change scope Open full search

PG.CENTER connects PostgreSQL documentation, reference, and ecosystem knowledge. Maintained by Pigsty.

FUNCTIONS / SYSTEM ADMINISTRATION FUNCTIONS

pg_last_wal_replay_lsn

Read PG 18 manual ↗

Returns the last write-ahead log location that has been replayed during recovery.

Signatures & examples

pg_last_wal_replay_lsn () → pg_lsn
Returns the last write-ahead log location that has been replayed during recovery. If recovery is still in progress this will increase monotonically. If recovery has completed then this will remain static at the location of the last WAL record applied during recovery. When the server has been started normally without recovery, the function returns NULL.
Version history 2
  1. PG 12 → 13changed
  2. PG 9.6 → 10added

Definition snapshot: 2026-09-14T13:14:25.684213+00:00@99e6866c · English manual source