{"Entry":{"collection":"catalog","key":"pg_stat_replication","name":"pg_stat_replication","aliases":[],"metadata":{"changed_in":["9.2","9.4","10","12"],"changes":[{"added":[],"attributes":[],"description_changed":false,"descriptions":[],"from":"9.0","order":false,"removed":[],"status":"added","to":"9.1","types":[]},{"added":["pid"],"attributes":[],"description_changed":true,"descriptions":[],"from":"9.1","listing":[],"order":false,"removed":["procpid"],"status":"changed","to":"9.2","types":[],"unlisted":[]},{"added":["backend_xmin"],"attributes":[],"description_changed":false,"descriptions":[],"from":"9.3","listing":[],"order":false,"removed":[],"status":"changed","to":"9.4","types":[{"from":"text","name":"flush_location","to":"pg_lsn"},{"from":"text","name":"replay_location","to":"pg_lsn"},{"from":"text","name":"sent_location","to":"pg_lsn"},{"from":"text","name":"write_location","to":"pg_lsn"}],"unlisted":[]},{"added":["sent_lsn","write_lsn","flush_lsn","replay_lsn","write_lag","flush_lag","replay_lag"],"attributes":[],"description_changed":false,"descriptions":[{"from":"Current WAL sender state","name":"state","to":"Current WAL sender state. Possible values are: startup: This WAL sender is starting up. catchup: This WAL sender's connected standby is catching up with the primary. streaming: This WAL sender is streaming changes after its connected standby server has caught up with the primary. backup: This WAL sender is sending a backup. stopping: This WAL sender is stopping."},{"from":"Priority of this standby server for being chosen as the synchronous standby","name":"sync_priority","to":"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."},{"from":"Synchronous state of this standby server","name":"sync_state","to":"Synchronous state of this standby server. Possible values are: async: This standby server is asynchronous. potential: This standby server is now asynchronous, but can potentially become synchronous if one of current synchronous ones fails. sync: This standby server is synchronous. quorum: This standby server is considered as a candidate for quorum standbys."}],"from":"9.6","listing":[],"order":false,"removed":["sent_location","write_location","flush_location","replay_location"],"status":"changed","to":"10","types":[],"unlisted":[]},{"added":["reply_time"],"attributes":[],"description_changed":false,"descriptions":[],"from":"11","listing":[],"order":false,"removed":[],"status":"changed","to":"12","types":[],"unlisted":[]},{"added":[],"attributes":[],"description_changed":true,"descriptions":[{"from":"Current WAL sender state. Possible values are: startup: This WAL sender is starting up. catchup: This WAL sender's connected standby is catching up with the primary. streaming: This WAL sender is streaming changes after its connected standby server has caught up with the primary. backup: This WAL sender is sending a backup. stopping: This WAL sender is stopping.","name":"state","to":"Current WAL sender state. Possible values are:\n\nstartup: This WAL sender is starting up. catchup: This WAL sender's connected standby is catching up with the primary. streaming: This WAL sender is streaming changes after its connected standby server has caught up with the primary. backup: This WAL sender is sending a backup. stopping: This WAL sender is stopping."},{"from":"Synchronous state of this standby server. Possible values are: async: This standby server is asynchronous. potential: This standby server is now asynchronous, but can potentially become synchronous if one of current synchronous ones fails. sync: This standby server is synchronous. quorum: This standby server is considered as a candidate for quorum standbys.","name":"sync_state","to":"Synchronous state of this standby server. Possible values are:\n\nasync: This standby server is asynchronous. potential: This standby server is now asynchronous, but can potentially become synchronous if one of current synchronous ones fails. sync: This standby server is synchronous. quorum: This standby server is considered as a candidate for quorum standbys."}],"from":"12","listing":[],"order":false,"removed":[],"status":"reworded","to":"13","types":[],"unlisted":[]},{"added":[],"attributes":[],"description_changed":false,"descriptions":[{"from":"This standby's xmin horizon reported by hot_standby_feedback.","name":"backend_xmin","to":"This standby's xmin horizon reported by hot_standby_feedback. This field will be null if a replication slot is used (in this case, the standby's xmin is shown in pg_replication_slots) or if hot_standby_feedback is disabled."}],"from":"18","listing":[],"order":false,"removed":[],"status":"reworded","to":"19","types":[],"unlisted":[]}],"column_count":20,"content_hash":"8b3f8066379873e42708cefbf05947a643a220c4f52a84ce96d6e039bf398913","first_version":"9.1","imported_at":"2026-09-30T00:40:55.968679+08:00","kind":"statistics","last_version":"20","name":"pg_stat_replication","position":104,"present_in":["9.1","9.2","9.3","9.4","9.5","9.6","10","11","12","13","14","15","16","17","18","19","20"],"relation_oid":null,"relkind":"v","shared":false,"source_rev":"english-manuals:74ace3042a76c7dafefae58cd9d92c5c5a43dfd855ec798fdb8d29017c2e3196","summary":"The pg_stat_replication view will contain one row per WAL sender process, showing statistics about replication to that sender's connected standby server.","summary_zh":""}},"Definition":{"Collection":"catalog","Key":"pg_stat_replication","SourceDatabase":"center","Version":"18","SourceTable":"catalog","SourceKey":"pg_stat_replication","SourceRevision":"english-manuals:74ace3042a76c7dafefae58cd9d92c5c5a43dfd855ec798fdb8d29017c2e3196","Facts":{"columns":[{"array_dimensions":0,"attnum":1,"description":"Process ID of a WAL sender process","description_zh":"","documented":true,"documented_name":"pid","hidden":false,"name":"pid","not_null":false,"references":"","type":"integer","type_modifier":-1,"type_oid":23},{"array_dimensions":0,"attnum":2,"description":"OID of the user logged into this WAL sender process","description_zh":"","documented":true,"documented_name":"usesysid","hidden":false,"name":"usesysid","not_null":false,"references":"","type":"oid","type_modifier":-1,"type_oid":26},{"array_dimensions":0,"attnum":3,"description":"Name of the user logged into this WAL sender process","description_zh":"","documented":true,"documented_name":"usename","hidden":false,"name":"usename","not_null":false,"references":"","type":"name","type_modifier":-1,"type_oid":19},{"array_dimensions":0,"attnum":4,"description":"Name of the application that is connected to this WAL sender","description_zh":"","documented":true,"documented_name":"application_name","hidden":false,"name":"application_name","not_null":false,"references":"","type":"text","type_modifier":-1,"type_oid":25},{"array_dimensions":0,"attnum":5,"description":"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.","description_zh":"","documented":true,"documented_name":"client_addr","hidden":false,"name":"client_addr","not_null":false,"references":"","type":"inet","type_modifier":-1,"type_oid":869},{"array_dimensions":0,"attnum":6,"description":"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.","description_zh":"","documented":true,"documented_name":"client_hostname","hidden":false,"name":"client_hostname","not_null":false,"references":"","type":"text","type_modifier":-1,"type_oid":25},{"array_dimensions":0,"attnum":7,"description":"TCP port number that the client is using for communication with this WAL sender, or -1 if a Unix socket is used","description_zh":"","documented":true,"documented_name":"client_port","hidden":false,"name":"client_port","not_null":false,"references":"","type":"integer","type_modifier":-1,"type_oid":23},{"array_dimensions":0,"attnum":8,"description":"Time when this process was started, i.e., when the client connected to this WAL sender","description_zh":"","documented":true,"documented_name":"backend_start","hidden":false,"name":"backend_start","not_null":false,"references":"","type":"timestamp with time zone","type_modifier":-1,"type_oid":1184},{"array_dimensions":0,"attnum":9,"description":"This standby's xmin horizon reported by hot_standby_feedback.","description_zh":"","documented":true,"documented_name":"backend_xmin","hidden":false,"name":"backend_xmin","not_null":false,"references":"","type":"xid","type_modifier":-1,"type_oid":28},{"array_dimensions":0,"attnum":10,"description":"Current WAL sender state. Possible values are:\n\nstartup: This WAL sender is starting up. catchup: This WAL sender's connected standby is catching up with the primary. streaming: This WAL sender is streaming changes after its connected standby server has caught up with the primary. backup: This WAL sender is sending a backup. stopping: This WAL sender is stopping.","description_zh":"","documented":true,"documented_name":"state","hidden":false,"name":"state","not_null":false,"references":"","type":"text","type_modifier":-1,"type_oid":25},{"array_dimensions":0,"attnum":11,"description":"Last write-ahead log location sent on this connection","description_zh":"","documented":true,"documented_name":"sent_lsn","hidden":false,"name":"sent_lsn","not_null":false,"references":"","type":"pg_lsn","type_modifier":-1,"type_oid":3220},{"array_dimensions":0,"attnum":12,"description":"Last write-ahead log location written to disk by this standby server","description_zh":"","documented":true,"documented_name":"write_lsn","hidden":false,"name":"write_lsn","not_null":false,"references":"","type":"pg_lsn","type_modifier":-1,"type_oid":3220},{"array_dimensions":0,"attnum":13,"description":"Last write-ahead log location flushed to disk by this standby server","description_zh":"","documented":true,"documented_name":"flush_lsn","hidden":false,"name":"flush_lsn","not_null":false,"references":"","type":"pg_lsn","type_modifier":-1,"type_oid":3220},{"array_dimensions":0,"attnum":14,"description":"Last write-ahead log location replayed into the database on this standby server","description_zh":"","documented":true,"documented_name":"replay_lsn","hidden":false,"name":"replay_lsn","not_null":false,"references":"","type":"pg_lsn","type_modifier":-1,"type_oid":3220},{"array_dimensions":0,"attnum":15,"description":"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.","description_zh":"","documented":true,"documented_name":"write_lag","hidden":false,"name":"write_lag","not_null":false,"references":"","type":"interval","type_modifier":-1,"type_oid":1186},{"array_dimensions":0,"attnum":16,"description":"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.","description_zh":"","documented":true,"documented_name":"flush_lag","hidden":false,"name":"flush_lag","not_null":false,"references":"","type":"interval","type_modifier":-1,"type_oid":1186},{"array_dimensions":0,"attnum":17,"description":"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.","description_zh":"","documented":true,"documented_name":"replay_lag","hidden":false,"name":"replay_lag","not_null":false,"references":"","type":"interval","type_modifier":-1,"type_oid":1186},{"array_dimensions":0,"attnum":18,"description":"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.","description_zh":"","documented":true,"documented_name":"sync_priority","hidden":false,"name":"sync_priority","not_null":false,"references":"","type":"integer","type_modifier":-1,"type_oid":23},{"array_dimensions":0,"attnum":19,"description":"Synchronous state of this standby server. Possible values are:\n\nasync: This standby server is asynchronous. potential: This standby server is now asynchronous, but can potentially become synchronous if one of current synchronous ones fails. sync: This standby server is synchronous. quorum: This standby server is considered as a candidate for quorum standbys.","description_zh":"","documented":true,"documented_name":"sync_state","hidden":false,"name":"sync_state","not_null":false,"references":"","type":"text","type_modifier":-1,"type_oid":25},{"array_dimensions":0,"attnum":20,"description":"Send time of last reply message received from standby server","description_zh":"","documented":true,"documented_name":"reply_time","hidden":false,"name":"reply_time","not_null":false,"references":"","type":"timestamp with time zone","type_modifier":-1,"type_oid":1184}],"description":"The pg_stat_replication view will contain one row per WAL sender process, showing statistics about replication to that sender's connected standby server. Only directly connected standbys are listed; no information is available about downstream standby servers.","description_zh":"","doc":{"anchor":"PG-STAT-REPLICATION-VIEW","file":"monitoring-stats.html","lang":"en","sha256":"aa979eed08627fbf715a9d792094a162a73671db5af810f3ab2aad3e073d5722","slug":"18"},"kind":"statistics","lang":"en","measured_attributes":true,"metadata_release":"18.6","runtime_columns":["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"],"runtime_verified":false,"source":"english-manual"},"ManualEvidence":{"doc":{"anchor":"PG-STAT-REPLICATION-VIEW","file":"monitoring-stats.html","lang":"en","sha256":"aa979eed08627fbf715a9d792094a162a73671db5af810f3ab2aad3e073d5722","slug":"18"}},"MeasuredEvidence":{"measured_attributes":true,"metadata_release":"18.6","runtime_columns":["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"],"runtime_verified":false}},"Text":{"Collection":"catalog","Key":"pg_stat_replication","SourceDatabase":"pgweb","Version":"18","Locale":"zh-Hans","Title":"pg_stat_replication","Summary":"pg_stat_replication视图为每个 WAL 发送进程包含一行，显示有关复制到该发送进程所连接备库的统计信息。这里只列出直接连接的备库；不包含下游备库的信息。","BodyHTML":"\u003cp\u003epg_stat_replication视图为每个 WAL 发送进程包含一行，显示有关复制到该发送进程所连接备库的统计信息。这里只列出直接连接的备库；不包含下游备库的信息。\u003c/p\u003e","SourceRevision":"2026-09-27@419045e","ContentHash":"499e451e43f3a9d4f334f771a0373d56b1ab0d3072726dbd32771684c46ad140","Payload":{"columns":[{"description_zh":"一个 WAL 发送进程的进程 ID","name":"pid","type":"integer","zh_from":"doc"},{"description_zh":"登录到这个 WAL 发送进程的用户的 OID","name":"usesysid","type":"oid","zh_from":"doc"},{"description_zh":"登录到这个 WAL 发送进程的用户的名称","name":"usename","type":"name","zh_from":"doc"},{"description_zh":"连接到这个 WAL 发送进程的应用的名称","name":"application_name","type":"text","zh_from":"doc"},{"description_zh":"连接到这个 WAL 发送进程的客户端的 IP 地址。如果这个字段为空值，它表示该客户端通过服务器机器上的一个Unix 套接字连接。","name":"client_addr","type":"inet","zh_from":"doc"},{"description_zh":"已连接的客户端的主机名，由client_addr的反向 DNS 查找报告。这个字段将只对 IP 连接非空，并且只有log_hostname被启用时才会非空。","name":"client_hostname","type":"text","zh_from":"doc"},{"description_zh":"客户端用来与这个 WAL 发送进程通讯的 TCP 端口号，如果使用 Unix 套接字则为-1","name":"client_port","type":"integer","zh_from":"doc"},{"description_zh":"这个进程开始的时间，即客户端是何时连接到这个WAL 发送进程的。","name":"backend_start","type":"timestamp with time zone","zh_from":"doc"},{"description_zh":"由hot_standby_feedback报告的该备库的xmin视界。","name":"backend_xmin","type":"xid","zh_from":"doc"},{"description_zh":"当前的 WAL 发送进程状态。可能的值是：","name":"state","type":"text","zh_from":"doc"},{"description_zh":"在这个连接上发送的最后一个预写式日志的位置","name":"sent_lsn","type":"pg_lsn","zh_from":"doc"},{"description_zh":"该备库已写入磁盘的最后一个预写式日志位置","name":"write_lsn","type":"pg_lsn","zh_from":"doc"},{"description_zh":"该备库已刷入磁盘的最后一个预写式日志位置","name":"flush_lsn","type":"pg_lsn","zh_from":"doc"},{"description_zh":"已在该备库数据库中重放的最后一个预写式日志位置","name":"replay_lsn","type":"pg_lsn","zh_from":"doc"},{"description_zh":"从在本地将最近的 WAL 刷盘，到收到该备库已写入该 WAL（但尚未刷盘或应用）的通知之间经过的时间。如果该服务器被配置为同步备库，可用此值衡量在提交时synchronous_commit级别remote_write所导致的延迟。","name":"write_lag","type":"interval","zh_from":"doc"},{"description_zh":"从在本地将最近的 WAL 刷盘，到收到该备库已写入该 WAL 并将其刷盘（但尚未应用）的通知之间经过的时间。如果该服务器被配置为同步备库，可用此值衡量在提交时synchronous_commit级别on所导致的延迟。","name":"flush_lag","type":"interval","zh_from":"doc"},{"description_zh":"从在本地将最近的 WAL 刷盘，到收到该备库已写入该 WAL、将其刷盘并应用的通知之间经过的时间。如果该服务器被配置为同步备库，可用此值衡量在提交时synchronous_commit级别remote_apply所导致的延迟。","name":"replay_lag","type":"interval","zh_from":"doc"},{"description_zh":"在基于优先级的同步复制中，该备库被选为同步备库的优先级。在基于法定人数的同步复制中，此值不起作用。","name":"sync_priority","type":"integer","zh_from":"doc"},{"description_zh":"该备库的同步状态。可能的值是：","name":"sync_state","type":"text","zh_from":"doc"},{"description_zh":"从备库收到的最后一条回复消息的发送时间","name":"reply_time","type":"timestamp with time zone","zh_from":"doc"}],"description_zh":"pg_stat_replication视图为每个 WAL 发送进程包含一行，显示有关复制到该发送进程所连接备库的统计信息。这里只列出直接连接的备库；不包含下游备库的信息。","zh_from":"doc"}},"RequestedLocale":"zh-Hans","Fallback":false,"Versions":["10","11","12","13","14","15","16","17","18","19","20","9.1","9.2","9.3","9.4","9.5","9.6"],"Locales":["en","zh-Hans"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
