Summary
The pg_stat_wal_receiver view will contain only one row, showing statistics about the WAL receiver from that receiver’s connected server.
(Description quoted from the official PostgreSQL documentation.)
Columns
The pg_stat_wal_receiver statistics view exposes the following columns (names, types and descriptions are taken verbatim from the PostgreSQL documentation):
pidinteger
Process ID of the WAL receiver processstatustext
Activity status of the WAL receiver process. Possible values are: restarting: WAL receiver has been asked to restart streaming. starting: WAL receiver process has been launched but is not yet initialized. connecting: WAL receiver is connecting to the upstream server, replication has not yet started. stopping: WAL receiver has been requested to stop. streaming: WAL receiver is streaming WAL data. waiting: WAL receiver has stopped streaming and is waiting for new instructions from the startup process.receive_start_lsnpg_lsn
First write-ahead log location used when WAL receiver is startedreceive_start_tliinteger
First timeline number used when WAL receiver is startedwritten_lsnpg_lsn
Last write-ahead log location already received and written to disk, but not flushed. This should not be used for data integrity checks.flushed_lsnpg_lsn
Last write-ahead log location already received and flushed to disk, the initial value of this field being the first log location used when WAL receiver is startedreceived_tliinteger
Timeline number of last write-ahead log location received and flushed to disk, the initial value of this field being the timeline number of the first log location used when WAL receiver is startedlast_msg_send_timetimestamp with time zone
Send time of last message received from origin WAL senderlast_msg_receipt_timetimestamp with time zone
Receipt time of last message received from origin WAL senderlatest_end_lsnpg_lsn
Last write-ahead log location reported to origin WAL senderlatest_end_timetimestamp with time zone
Time of last write-ahead log location reported to origin WAL senderslot_nametext
Replication slot name used by this WAL receiversender_hosttext
Host of the PostgreSQL instance this WAL receiver is connected to. This can be a host name, an IP address, or a directory path if the connection is via Unix socket. (The path case can be distinguished because it will always be an absolute path, beginning with /.)sender_portinteger
Port number of the PostgreSQL instance this WAL receiver is connected to.conninfotext
Connection string used by this WAL receiver, with security-sensitive fields obfuscated.
Version applicability
Present in PostgreSQL 17, 18, 19 (verified against each release’s documentation). This is a long-standing system object that also exists in earlier PostgreSQL releases.
Related & references
Reference: PostgreSQL documentation — pg_stat_wal_receiver.