SYSTEM CATALOGS / STATISTICS VIEWS
pg_stat_replication
Read PG 18 manual ↗The pg_stat_replication view will contain one row per WAL sender process, showing statistics about replication to that sender's connected standby server.
- Kind
- Statistics views
- Columns in this snapshot
- 20
- Definition source
- English manual
Columns 20
| Column | Type | Description / reference |
|---|---|---|
pid | integer | Process ID of a WAL sender process |
usesysid | oid | OID of the user logged into this WAL sender process |
usename | name | Name of the user logged into this WAL sender process |
application_name | text | Name of the application that is connected to this WAL sender |
client_addr | inet | IP address of the client connected to this WAL sender. If this field is null, it indicates that the client is connected via a Unix socket on the server machine. |
client_hostname | text | Host name of the connected client, as reported by a reverse DNS lookup of client_addr. This field will only be non-null for IP connections, and only when log_hostname is enabled. |
client_port | integer | TCP port number that the client is using for communication with this WAL sender, or -1 if a Unix socket is used |
backend_start | timestamp with time zone | Time when this process was started, i.e., when the client connected to this WAL sender |
backend_xmin | xid | This standby's xmin horizon reported by hot_standby_feedback. |
state | text | Current WAL sender state. Possible values are: |
sent_lsn | pg_lsn | Last write-ahead log location sent on this connection |
write_lsn | pg_lsn | Last write-ahead log location written to disk by this standby server |
flush_lsn | pg_lsn | Last write-ahead log location flushed to disk by this standby server |
replay_lsn | pg_lsn | Last write-ahead log location replayed into the database on this standby server |
write_lag | interval | Time elapsed between flushing recent WAL locally and receiving notification that this standby server has written it (but not yet flushed it or applied it). This can be used to gauge the delay that synchronous_commit level remote_write incurred while committing if this server was configured as a synchronous standby. |
flush_lag | interval | Time elapsed between flushing recent WAL locally and receiving notification that this standby server has written and flushed it (but not yet applied it). This can be used to gauge the delay that synchronous_commit level on incurred while committing if this server was configured as a synchronous standby. |
replay_lag | interval | Time elapsed between flushing recent WAL locally and receiving notification that this standby server has written, flushed and applied it. This can be used to gauge the delay that synchronous_commit level remote_apply incurred while committing if this server was configured as a synchronous standby. |
sync_priority | integer | Priority of this standby server for being chosen as the synchronous standby in a priority-based synchronous replication. This has no effect in a quorum-based synchronous replication. |
sync_state | text | Synchronous state of this standby server. Possible values are: |
reply_time | timestamp with time zone | Send time of last reply message received from standby server |
Column history across versions
| Column | 9.0 | 9.1 | 9.2 | 9.3 | 9.4 | 9.5 | 9.6 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
pid | · | · | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● |
usesysid | · | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● |
usename | · | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● |
application_name | · | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● |
client_addr | · | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● |
client_hostname | · | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● |
client_port | · | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● |
backend_start | · | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● |
backend_xmin | · | · | · | · | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● |
state | · | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● |
sent_lsn | · | · | · | · | · | · | · | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● |
write_lsn | · | · | · | · | · | · | · | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● |
flush_lsn | · | · | · | · | · | · | · | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● |
replay_lsn | · | · | · | · | · | · | · | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● |
write_lag | · | · | · | · | · | · | · | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● |
flush_lag | · | · | · | · | · | · | · | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● |
replay_lag | · | · | · | · | · | · | · | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● |
sync_priority | · | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● |
sync_state | · | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● |
reply_time | · | · | · | · | · | · | · | · | · | ● | ● | ● | ● | ● | ● | ● | ● | ● |
procpid | · | ● | · | · | · | · | · | · | · | · | · | · | · | · | · | · | · | · |
sent_location | · | ● | ● | ● | ● | ● | ● | · | · | · | · | · | · | · | · | · | · | · |
write_location | · | ● | ● | ● | ● | ● | ● | · | · | · | · | · | · | · | · | · | · | · |
flush_location | · | ● | ● | ● | ● | ● | ● | · | · | · | · | · | · | · | · | · | · | · |
replay_location | · | ● | ● | ● | ● | ● | ● | · | · | · | · | · | · | · | · | · | · | · |
Version history 9
- PG 18 → 19changed
- PG 12 → 13changed
- PG 11 → 12changed
- PG 9.6 → 10changed
- PG 9.5 → 9.6changed
- PG 9.4 → 9.5changed
- PG 9.3 → 9.4changed
- PG 9.1 → 9.2changed
- PG 9.0 → 9.1added
Definition snapshot: english-manuals:d4a08debb9e630c965123247dec… · English manual source