Summary
The pg_stat_recovery view will contain only one row, showing statistics about the recovery state of the startup process. This view returns no row when the server is not in recovery.
(Description quoted from the official PostgreSQL documentation.)
Columns
The pg_stat_recovery statistics view exposes the following columns (names, types and descriptions are taken verbatim from the PostgreSQL documentation):
promote_triggeredboolean
True if a promotion has been triggered.last_replayed_read_lsnpg_lsn
Start write-ahead log location of the last successfully replayed WAL tuple/">record.last_replayed_end_lsnpg_lsn
End write-ahead log location of the last successfully replayed WAL record.last_replayed_tliinteger
Timeline of the last successfully replayed WAL record.replay_end_lsnpg_lsn
Write-ahead log location of the record currently being replayed (end position plus one). When no record is being actively replayed, equals last_replayed_end_lsn.replay_end_tliinteger
Timeline of the WAL record currently being replayed.recovery_last_xact_timetimestamp with time zone
Timestamp of the last transaction commit or abort replayed during recovery. This is the time at which the commit or abort WAL record for that transaction was generated on the primary.current_chunk_start_timetimestamp with time zone
Time when the startup process observed that replay had caught up with the latest received WAL chunk. Used in recovery-conflict timing and replay/apply-lag diagnostics. NULL if not yet available.pause_statetext
Recovery pause state. Possible values are: not paused: Recovery is proceeding normally. pause requested: A pause has been requested but recovery has not yet paused. paused: Recovery is paused.
Version applicability
Present in PostgreSQL 19 (verified against each release’s documentation). This object was introduced in PostgreSQL 19.
Related & references
Reference: PostgreSQL documentation — pg_stat_recovery.