{"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":"33291fc67d3b5a2433ee96e0051c8ea349298fd36b4d4946a9995fbbd34a1db5","derived_content_hash":"2244a9966cd86132f68cc77116e72259110dce4ea9aea8b900388819a90fff26","documentation_refresh":{"batch":"20261113","original_source_rev":"catalog-bilingual-repair:5c6946fcce7ceee8fcf81dd9e05660405e497e36ad507841dd92cd2118ba00aa","versions":{"14":"14.25","15":"15.20","16":"16.16","17":"17.12","18":"18.7","19":"19rc2"}},"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":"catalog-bilingual-repair:5c6946fcce7ceee8fcf81dd9e05660405e497e36ad507841dd92cd2118ba00aa","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":"pg_stat_replication 视图为每个 WAL 发送进程包含一行，显示有关复制到该发送进程所连接备库的统计信息。这里只列出直接连接的备库；不包含下游备库的信息。"}},"Definition":{"Collection":"catalog","Key":"pg_stat_replication","SourceDatabase":"center","Version":"18","SourceTable":"catalog","SourceKey":"pg_stat_replication","SourceRevision":"catalog-bilingual-repair:5c6946fcce7ceee8fcf81dd9e05660405e497e36ad507841dd92cd2118ba00aa","Facts":{"columns":[{"array_dimensions":0,"attnum":1,"description":"Process ID of a WAL sender process","description_zh":"一个 WAL 发送进程的进程 ID","documented":true,"documented_name":"pid","hidden":false,"name":"pid","not_null":false,"references":"","type":"integer","type_modifier":-1,"type_oid":23,"zh_from":"same-version-manual"},{"array_dimensions":0,"attnum":2,"description":"OID of the user logged into this WAL sender process","description_zh":"登录到这个 WAL 发送进程的用户的 OID","documented":true,"documented_name":"usesysid","hidden":false,"name":"usesysid","not_null":false,"references":"","type":"oid","type_modifier":-1,"type_oid":26,"zh_from":"same-version-manual"},{"array_dimensions":0,"attnum":3,"description":"Name of the user logged into this WAL sender process","description_zh":"登录到这个 WAL 发送进程的用户的名称","documented":true,"documented_name":"usename","hidden":false,"name":"usename","not_null":false,"references":"","type":"name","type_modifier":-1,"type_oid":19,"zh_from":"same-version-manual"},{"array_dimensions":0,"attnum":4,"description":"Name of the application that is connected to this WAL sender","description_zh":"连接到这个 WAL 发送进程的应用的名称","documented":true,"documented_name":"application_name","hidden":false,"name":"application_name","not_null":false,"references":"","type":"text","type_modifier":-1,"type_oid":25,"zh_from":"same-version-manual"},{"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":"连接到这个 WAL 发送进程的客户端的 IP 地址。如果这个字段为空值，它表示该客户端通过服务器机器上的一个 Unix 套接字连接。","documented":true,"documented_name":"client_addr","hidden":false,"name":"client_addr","not_null":false,"references":"","type":"inet","type_modifier":-1,"type_oid":869,"zh_from":"same-version-manual"},{"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":"已连接的客户端的主机名，由 client_addr 的反向 DNS 查找报告。这个字段将只对 IP 连接非空，并且只有 log_hostname 被启用时才会非空。","documented":true,"documented_name":"client_hostname","hidden":false,"name":"client_hostname","not_null":false,"references":"","type":"text","type_modifier":-1,"type_oid":25,"zh_from":"same-version-manual"},{"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":"客户端用来与这个 WAL 发送进程通讯的 TCP 端口号，如果使用 Unix 套接字则为 -1","documented":true,"documented_name":"client_port","hidden":false,"name":"client_port","not_null":false,"references":"","type":"integer","type_modifier":-1,"type_oid":23,"zh_from":"same-version-manual"},{"array_dimensions":0,"attnum":8,"description":"Time when this process was started, i.e., when the client connected to this WAL sender","description_zh":"这个进程开始的时间，即客户端是何时连接到这个 WAL 发送进程的。","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,"zh_from":"same-version-manual"},{"array_dimensions":0,"attnum":9,"description":"This standby's xmin horizon reported by hot_standby_feedback.","description_zh":"由 hot_standby_feedback 报告的该备库的 xmin 视界。","documented":true,"documented_name":"backend_xmin","hidden":false,"name":"backend_xmin","not_null":false,"references":"","type":"xid","type_modifier":-1,"type_oid":28,"zh_from":"same-version-manual"},{"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":"当前的 WAL 发送进程状态。可能的值是：\n\nstartup：此 WAL 发送进程正在启动。 catchup：与此 WAL 发送进程连接的备库正在赶上主库。 streaming：在其连接的备库赶上主库之后，此 WAL 发送进程正在流式传输更改。 backup：此 WAL 发送进程正在发送一个备份。 stopping：此 WAL 发送进程正在停止。","documented":true,"documented_name":"state","hidden":false,"name":"state","not_null":false,"references":"","type":"text","type_modifier":-1,"type_oid":25,"zh_from":"same-version-manual"},{"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,"zh_from":"same-version-manual"},{"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,"zh_from":"same-version-manual"},{"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,"zh_from":"same-version-manual"},{"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,"zh_from":"same-version-manual"},{"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":"从在本地将最近的 WAL 刷盘，到收到该备库已写入该 WAL（但尚未刷盘或应用）的通知之间经过的时间。如果该服务器被配置为同步备库，可用此值衡量在提交时 synchronous_commit 级别 remote_write 所导致的延迟。","documented":true,"documented_name":"write_lag","hidden":false,"name":"write_lag","not_null":false,"references":"","type":"interval","type_modifier":-1,"type_oid":1186,"zh_from":"same-version-manual"},{"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":"从在本地将最近的 WAL 刷盘，到收到该备库已写入该 WAL 并将其刷盘（但尚未应用）的通知之间经过的时间。如果该服务器被配置为同步备库，可用此值衡量在提交时 synchronous_commit 级别 on 所导致的延迟。","documented":true,"documented_name":"flush_lag","hidden":false,"name":"flush_lag","not_null":false,"references":"","type":"interval","type_modifier":-1,"type_oid":1186,"zh_from":"same-version-manual"},{"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":"从在本地将最近的 WAL 刷盘，到收到该备库已写入该 WAL、将其刷盘并应用的通知之间经过的时间。如果该服务器被配置为同步备库，可用此值衡量在提交时 synchronous_commit 级别 remote_apply 所导致的延迟。","documented":true,"documented_name":"replay_lag","hidden":false,"name":"replay_lag","not_null":false,"references":"","type":"interval","type_modifier":-1,"type_oid":1186,"zh_from":"same-version-manual"},{"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,"zh_from":"same-version-manual"},{"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":"该备库的同步状态。可能的值是：\n\nasync：该备库是异步的。 potential：该备库当前是异步的，但在当前某个同步备库失效时可能变为同步的。 sync：该备库是同步的。 quorum：该备库被视为法定人数同步复制的候选备库。","documented":true,"documented_name":"sync_state","hidden":false,"name":"sync_state","not_null":false,"references":"","type":"text","type_modifier":-1,"type_oid":25,"zh_from":"same-version-manual"},{"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,"zh_from":"same-version-manual"}],"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":"pg_stat_replication 视图为每个 WAL 发送进程包含一行，显示有关复制到该发送进程所连接备库的统计信息。这里只列出直接连接的备库；不包含下游备库的信息。","description_zh_html":"\u003cp\u003epg_stat_replication 视图为每个 WAL 发送进程包含一行，显示有关复制到该发送进程所连接备库的统计信息。这里只列出直接连接的备库；不包含下游备库的信息。\u003c/p\u003e\u003cdiv class=\"table\" id=\"PG-STAT-REPLICATION-VIEW\"\u003e\u003cp class=\"title\"\u003e\u003cstrong\u003e表 27.14. \u003ccode class=\"structname\"\u003epg_stat_replication\u003c/code\u003e 视图\u003c/strong\u003e\u003c/p\u003e\u003cdiv class=\"table-contents\"\u003e\u003ctable border=\"1\" class=\"table\" summary=\"pg_stat_replication 视图\"\u003e\u003ccolgroup\u003e\u003ccol/\u003e\u003c/colgroup\u003e\u003cthead\u003e\u003ctr\u003e\u003cth class=\"catalog_table_entry\"\u003e\u003cp class=\"column_definition\"\u003e\n       列类型\n      \u003c/p\u003e\n\u003cp\u003e\n       描述\n      \u003c/p\u003e\u003c/th\u003e\u003c/tr\u003e\u003c/thead\u003e\u003ctbody\u003e\u003ctr\u003e\u003ctd class=\"catalog_table_entry\"\u003e\u003cp class=\"column_definition\"\u003e\n\u003ccode class=\"structfield\"\u003epid\u003c/code\u003e \u003ccode class=\"type\"\u003einteger\u003c/code\u003e\n\u003c/p\u003e\n\u003cp\u003e\n       一个 WAL 发送进程的进程 ID\n      \u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd class=\"catalog_table_entry\"\u003e\u003cp class=\"column_definition\"\u003e\n\u003ccode class=\"structfield\"\u003eusesysid\u003c/code\u003e \u003ccode class=\"type\"\u003eoid\u003c/code\u003e\n\u003c/p\u003e\n\u003cp\u003e\n       登录到这个 WAL 发送进程的用户的 OID\n      \u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd class=\"catalog_table_entry\"\u003e\u003cp class=\"column_definition\"\u003e\n\u003ccode class=\"structfield\"\u003eusename\u003c/code\u003e \u003ccode class=\"type\"\u003ename\u003c/code\u003e\n\u003c/p\u003e\n\u003cp\u003e\n       登录到这个 WAL 发送进程的用户的名称\n      \u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd class=\"catalog_table_entry\"\u003e\u003cp class=\"column_definition\"\u003e\n\u003ccode class=\"structfield\"\u003eapplication_name\u003c/code\u003e \u003ccode class=\"type\"\u003etext\u003c/code\u003e\n\u003c/p\u003e\n\u003cp\u003e\n       连接到这个 WAL 发送进程的应用的名称\n      \u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd class=\"catalog_table_entry\"\u003e\u003cp class=\"column_definition\"\u003e\n\u003ccode class=\"structfield\"\u003eclient_addr\u003c/code\u003e \u003ccode class=\"type\"\u003einet\u003c/code\u003e\n\u003c/p\u003e\n\u003cp\u003e\n       连接到这个 WAL 发送进程的客户端的 IP 地址。如果这个字段为空值，它表示该客户端通过服务器机器上的一个 Unix 套接字连接。\n      \u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd class=\"catalog_table_entry\"\u003e\u003cp class=\"column_definition\"\u003e\n\u003ccode class=\"structfield\"\u003eclient_hostname\u003c/code\u003e \u003ccode class=\"type\"\u003etext\u003c/code\u003e\n\u003c/p\u003e\n\u003cp\u003e\n       已连接的客户端的主机名，由 \u003ccode class=\"structfield\"\u003eclient_addr\u003c/code\u003e 的反向 DNS 查找报告。这个字段将只对 IP 连接非空，并且只有 \u003ca class=\"xref\" href=\"/zh/docs/18/runtime-config-logging.html#GUC-LOG-HOSTNAME\"\u003elog_hostname\u003c/a\u003e 被启用时才会非空。\n      \u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd class=\"catalog_table_entry\"\u003e\u003cp class=\"column_definition\"\u003e\n\u003ccode class=\"structfield\"\u003eclient_port\u003c/code\u003e \u003ccode class=\"type\"\u003einteger\u003c/code\u003e\n\u003c/p\u003e\n\u003cp\u003e\n       客户端用来与这个 WAL 发送进程通讯的 TCP 端口号，如果使用 Unix 套接字则为 \u003ccode class=\"literal\"\u003e-1\u003c/code\u003e\n\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd class=\"catalog_table_entry\"\u003e\u003cp class=\"column_definition\"\u003e\n\u003ccode class=\"structfield\"\u003ebackend_start\u003c/code\u003e \u003ccode class=\"type\"\u003etimestamp with time zone\u003c/code\u003e\n\u003c/p\u003e\n\u003cp\u003e\n       这个进程开始的时间，即客户端是何时连接到这个 WAL 发送进程的。\n      \u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd class=\"catalog_table_entry\"\u003e\u003cp class=\"column_definition\"\u003e\n\u003ccode class=\"structfield\"\u003ebackend_xmin\u003c/code\u003e \u003ccode class=\"type\"\u003exid\u003c/code\u003e\n\u003c/p\u003e\n\u003cp\u003e\n       由 \u003ca class=\"xref\" href=\"/zh/docs/18/runtime-config-replication.html#GUC-HOT-STANDBY-FEEDBACK\"\u003ehot_standby_feedback\u003c/a\u003e 报告的该备库的 \u003ccode class=\"literal\"\u003exmin\u003c/code\u003e 视界。\n      \u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd class=\"catalog_table_entry\"\u003e\u003cp class=\"column_definition\"\u003e\n\u003ccode class=\"structfield\"\u003estate\u003c/code\u003e \u003ccode class=\"type\"\u003etext\u003c/code\u003e\n\u003c/p\u003e\n\u003cp\u003e\n       当前的 WAL 发送进程状态。可能的值是：\n       \u003c/p\u003e\u003cdiv class=\"itemizedlist\"\u003e\u003cul class=\"itemizedlist\" style=\"list-style-type: disc; \"\u003e\u003cli class=\"listitem\"\u003e\u003cp\u003e\n\u003ccode class=\"literal\"\u003estartup\u003c/code\u003e：此 WAL 发送进程正在启动。\n         \u003c/p\u003e\u003c/li\u003e\u003cli class=\"listitem\"\u003e\u003cp\u003e\n\u003ccode class=\"literal\"\u003ecatchup\u003c/code\u003e：与此 WAL 发送进程连接的备库正在赶上主库。\n         \u003c/p\u003e\u003c/li\u003e\u003cli class=\"listitem\"\u003e\u003cp\u003e\n\u003ccode class=\"literal\"\u003estreaming\u003c/code\u003e：在其连接的备库赶上主库之后，此 WAL 发送进程正在流式传输更改。\n         \u003c/p\u003e\u003c/li\u003e\u003cli class=\"listitem\"\u003e\u003cp\u003e\n\u003ccode class=\"literal\"\u003ebackup\u003c/code\u003e：此 WAL 发送进程正在发送一个备份。\n         \u003c/p\u003e\u003c/li\u003e\u003cli class=\"listitem\"\u003e\u003cp\u003e\n\u003ccode class=\"literal\"\u003estopping\u003c/code\u003e：此 WAL 发送进程正在停止。\n         \u003c/p\u003e\u003c/li\u003e\u003c/ul\u003e\u003c/div\u003e\u003cp\u003e\n\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd class=\"catalog_table_entry\"\u003e\u003cp class=\"column_definition\"\u003e\n\u003ccode class=\"structfield\"\u003esent_lsn\u003c/code\u003e \u003ccode class=\"type\"\u003epg_lsn\u003c/code\u003e\n\u003c/p\u003e\n\u003cp\u003e\n       在这个连接上发送的最后一个预写式日志的位置\n      \u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd class=\"catalog_table_entry\"\u003e\u003cp class=\"column_definition\"\u003e\n\u003ccode class=\"structfield\"\u003ewrite_lsn\u003c/code\u003e \u003ccode class=\"type\"\u003epg_lsn\u003c/code\u003e\n\u003c/p\u003e\n\u003cp\u003e\n       该备库已写入磁盘的最后一个预写式日志位置\n      \u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd class=\"catalog_table_entry\"\u003e\u003cp class=\"column_definition\"\u003e\n\u003ccode class=\"structfield\"\u003eflush_lsn\u003c/code\u003e \u003ccode class=\"type\"\u003epg_lsn\u003c/code\u003e\n\u003c/p\u003e\n\u003cp\u003e\n       该备库已刷入磁盘的最后一个预写式日志位置\n      \u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd class=\"catalog_table_entry\"\u003e\u003cp class=\"column_definition\"\u003e\n\u003ccode class=\"structfield\"\u003ereplay_lsn\u003c/code\u003e \u003ccode class=\"type\"\u003epg_lsn\u003c/code\u003e\n\u003c/p\u003e\n\u003cp\u003e\n       已在该备库数据库中重放的最后一个预写式日志位置\n      \u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd class=\"catalog_table_entry\"\u003e\u003cp class=\"column_definition\"\u003e\n\u003ccode class=\"structfield\"\u003ewrite_lag\u003c/code\u003e \u003ccode class=\"type\"\u003einterval\u003c/code\u003e\n\u003c/p\u003e\n\u003cp\u003e从在本地将最近的 WAL 刷盘，到收到该备库已写入该 WAL（但尚未刷盘或应用）的通知之间经过的时间。如果该服务器被配置为同步备库，可用此值衡量在提交时 \u003ccode class=\"literal\"\u003esynchronous_commit\u003c/code\u003e 级别 \u003ccode class=\"literal\"\u003eremote_write\u003c/code\u003e 所导致的延迟。\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd class=\"catalog_table_entry\"\u003e\u003cp class=\"column_definition\"\u003e\n\u003ccode class=\"structfield\"\u003eflush_lag\u003c/code\u003e \u003ccode class=\"type\"\u003einterval\u003c/code\u003e\n\u003c/p\u003e\n\u003cp\u003e从在本地将最近的 WAL 刷盘，到收到该备库已写入该 WAL 并将其刷盘（但尚未应用）的通知之间经过的时间。如果该服务器被配置为同步备库，可用此值衡量在提交时 \u003ccode class=\"literal\"\u003esynchronous_commit\u003c/code\u003e 级别 \u003ccode class=\"literal\"\u003eon\u003c/code\u003e 所导致的延迟。\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd class=\"catalog_table_entry\"\u003e\u003cp class=\"column_definition\"\u003e\n\u003ccode class=\"structfield\"\u003ereplay_lag\u003c/code\u003e \u003ccode class=\"type\"\u003einterval\u003c/code\u003e\n\u003c/p\u003e\n\u003cp\u003e从在本地将最近的 WAL 刷盘，到收到该备库已写入该 WAL、将其刷盘并应用的通知之间经过的时间。如果该服务器被配置为同步备库，可用此值衡量在提交时 \u003ccode class=\"literal\"\u003esynchronous_commit\u003c/code\u003e 级别 \u003ccode class=\"literal\"\u003eremote_apply\u003c/code\u003e 所导致的延迟。\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd class=\"catalog_table_entry\"\u003e\u003cp class=\"column_definition\"\u003e\n\u003ccode class=\"structfield\"\u003esync_priority\u003c/code\u003e \u003ccode class=\"type\"\u003einteger\u003c/code\u003e\n\u003c/p\u003e\n\u003cp\u003e\n       在基于优先级的同步复制中，该备库被选为同步备库的优先级。在基于法定人数的同步复制中，此值不起作用。\n      \u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd class=\"catalog_table_entry\"\u003e\u003cp class=\"column_definition\"\u003e\n\u003ccode class=\"structfield\"\u003esync_state\u003c/code\u003e \u003ccode class=\"type\"\u003etext\u003c/code\u003e\n\u003c/p\u003e\n\u003cp\u003e\n       该备库的同步状态。可能的值是：\n       \u003c/p\u003e\u003cdiv class=\"itemizedlist\"\u003e\u003cul class=\"itemizedlist\" style=\"list-style-type: disc; \"\u003e\u003cli class=\"listitem\"\u003e\u003cp\u003e\n\u003ccode class=\"literal\"\u003easync\u003c/code\u003e：该备库是异步的。\n         \u003c/p\u003e\u003c/li\u003e\u003cli class=\"listitem\"\u003e\u003cp\u003e\n\u003ccode class=\"literal\"\u003epotential\u003c/code\u003e：该备库当前是异步的，但在当前某个同步备库失效时可能变为同步的。\n         \u003c/p\u003e\u003c/li\u003e\u003cli class=\"listitem\"\u003e\u003cp\u003e\n\u003ccode class=\"literal\"\u003esync\u003c/code\u003e：该备库是同步的。\n         \u003c/p\u003e\u003c/li\u003e\u003cli class=\"listitem\"\u003e\u003cp\u003e\n\u003ccode class=\"literal\"\u003equorum\u003c/code\u003e：该备库被视为法定人数同步复制的候选备库。\n         \u003c/p\u003e\u003c/li\u003e\u003c/ul\u003e\u003c/div\u003e\u003cp\u003e\n\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd class=\"catalog_table_entry\"\u003e\u003cp class=\"column_definition\"\u003e\n\u003ccode class=\"structfield\"\u003ereply_time\u003c/code\u003e \u003ccode class=\"type\"\u003etimestamp with time zone\u003c/code\u003e\n\u003c/p\u003e\n\u003cp\u003e\n       从备库收到的最后一条回复消息的发送时间\n      \u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003c/tbody\u003e\u003c/table\u003e\u003c/div\u003e\u003c/div\u003e","doc":{"anchor":"PG-STAT-REPLICATION-VIEW","file":"monitoring-stats.html","lang":"en","sha256":"a97e4aa05484b41cec1f4c9b0b9c5a083596a056982e5d5ba0db1dd8d49961fb","slug":"18"},"documentation_revision":{"inputs":[{"file":"monitoring-stats.html","kind":"same-version-reviewed-manual","locale":"en","sha256":"a97e4aa05484b41cec1f4c9b0b9c5a083596a056982e5d5ba0db1dd8d49961fb","version":"18.7"},{"file":"monitoring-stats.html","kind":"same-version-reviewed-manual","locale":"zh-Hans","sha256":"1ddb6576fe569e029a1c776c82e7add6be8e4f41705bcd8f66f4347fe23372b6","version":"18.7"}],"release":"18.7","runtime_remeasured":false,"source_revision":"pgdoc:b9f0e7232f60f380d642ac9b99226606c254b552"},"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","sources":[{"evidence":[{"build_id":107,"kind":"same-version-manual","locale":"zh-Hans","page":"monitoring-stats.html","sha256":"0274aac7991450316bcf7be44635653b6d896fb00e321242c1b6674cb05c2e53","source_revision":"unknown:rendered-translation-baseline","translation_revision":"git:b1b500221dbe5437cfca004d6b04d3f6e422765d;html-sha256:08e987a66af27b98444a8057c256314eafa13611a3fb9e888214fc436824244b","version":"18"}],"kind":"catalog-bilingual-repair","prior_source_revision":"english-manuals:74ace3042a76c7dafefae58cd9d92c5c5a43dfd855ec798fdb8d29017c2e3196","version":"18"}],"zh_from":"same-version-manual"},"ManualEvidence":{"doc":{"anchor":"PG-STAT-REPLICATION-VIEW","file":"monitoring-stats.html","lang":"en","sha256":"a97e4aa05484b41cec1f4c9b0b9c5a083596a056982e5d5ba0db1dd8d49961fb","slug":"18"},"sources":[{"evidence":[{"build_id":107,"kind":"same-version-manual","locale":"zh-Hans","page":"monitoring-stats.html","sha256":"0274aac7991450316bcf7be44635653b6d896fb00e321242c1b6674cb05c2e53","source_revision":"unknown:rendered-translation-baseline","translation_revision":"git:b1b500221dbe5437cfca004d6b04d3f6e422765d;html-sha256:08e987a66af27b98444a8057c256314eafa13611a3fb9e888214fc436824244b","version":"18"}],"kind":"catalog-bilingual-repair","prior_source_revision":"english-manuals:74ace3042a76c7dafefae58cd9d92c5c5a43dfd855ec798fdb8d29017c2e3196","version":"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":"center","Version":"18","Locale":"en","Title":"pg_stat_replication","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. Only directly connected standbys are listed; no information is available about downstream standby servers.","BodyHTML":"\u003cp\u003eThe pg_stat_replication view will contain one row per WAL sender process, showing statistics about replication to that sender\u0026#39;s connected standby server. Only directly connected standbys are listed; no information is available about downstream standby servers.\u003c/p\u003e","SourceRevision":"catalog-bilingual-repair:5c6946fcce7ceee8fcf81dd9e05660405e497e36ad507841dd92cd2118ba00aa","ContentHash":"ce848889b108e8d1940d229079ac85456ed5179957122f842651be1e80c693b1","Payload":{"columns":[{"array_dimensions":0,"attnum":1,"description":"Process ID of a WAL sender process","description_zh":"一个 WAL 发送进程的进程 ID","documented":true,"documented_name":"pid","hidden":false,"name":"pid","not_null":false,"references":"","type":"integer","type_modifier":-1,"type_oid":23,"zh_from":"same-version-manual"},{"array_dimensions":0,"attnum":2,"description":"OID of the user logged into this WAL sender process","description_zh":"登录到这个 WAL 发送进程的用户的 OID","documented":true,"documented_name":"usesysid","hidden":false,"name":"usesysid","not_null":false,"references":"","type":"oid","type_modifier":-1,"type_oid":26,"zh_from":"same-version-manual"},{"array_dimensions":0,"attnum":3,"description":"Name of the user logged into this WAL sender process","description_zh":"登录到这个 WAL 发送进程的用户的名称","documented":true,"documented_name":"usename","hidden":false,"name":"usename","not_null":false,"references":"","type":"name","type_modifier":-1,"type_oid":19,"zh_from":"same-version-manual"},{"array_dimensions":0,"attnum":4,"description":"Name of the application that is connected to this WAL sender","description_zh":"连接到这个 WAL 发送进程的应用的名称","documented":true,"documented_name":"application_name","hidden":false,"name":"application_name","not_null":false,"references":"","type":"text","type_modifier":-1,"type_oid":25,"zh_from":"same-version-manual"},{"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":"连接到这个 WAL 发送进程的客户端的 IP 地址。如果这个字段为空值，它表示该客户端通过服务器机器上的一个 Unix 套接字连接。","documented":true,"documented_name":"client_addr","hidden":false,"name":"client_addr","not_null":false,"references":"","type":"inet","type_modifier":-1,"type_oid":869,"zh_from":"same-version-manual"},{"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":"已连接的客户端的主机名，由 client_addr 的反向 DNS 查找报告。这个字段将只对 IP 连接非空，并且只有 log_hostname 被启用时才会非空。","documented":true,"documented_name":"client_hostname","hidden":false,"name":"client_hostname","not_null":false,"references":"","type":"text","type_modifier":-1,"type_oid":25,"zh_from":"same-version-manual"},{"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":"客户端用来与这个 WAL 发送进程通讯的 TCP 端口号，如果使用 Unix 套接字则为 -1","documented":true,"documented_name":"client_port","hidden":false,"name":"client_port","not_null":false,"references":"","type":"integer","type_modifier":-1,"type_oid":23,"zh_from":"same-version-manual"},{"array_dimensions":0,"attnum":8,"description":"Time when this process was started, i.e., when the client connected to this WAL sender","description_zh":"这个进程开始的时间，即客户端是何时连接到这个 WAL 发送进程的。","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,"zh_from":"same-version-manual"},{"array_dimensions":0,"attnum":9,"description":"This standby's xmin horizon reported by hot_standby_feedback.","description_zh":"由 hot_standby_feedback 报告的该备库的 xmin 视界。","documented":true,"documented_name":"backend_xmin","hidden":false,"name":"backend_xmin","not_null":false,"references":"","type":"xid","type_modifier":-1,"type_oid":28,"zh_from":"same-version-manual"},{"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":"当前的 WAL 发送进程状态。可能的值是：\n\nstartup：此 WAL 发送进程正在启动。 catchup：与此 WAL 发送进程连接的备库正在赶上主库。 streaming：在其连接的备库赶上主库之后，此 WAL 发送进程正在流式传输更改。 backup：此 WAL 发送进程正在发送一个备份。 stopping：此 WAL 发送进程正在停止。","documented":true,"documented_name":"state","hidden":false,"name":"state","not_null":false,"references":"","type":"text","type_modifier":-1,"type_oid":25,"zh_from":"same-version-manual"},{"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,"zh_from":"same-version-manual"},{"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,"zh_from":"same-version-manual"},{"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,"zh_from":"same-version-manual"},{"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,"zh_from":"same-version-manual"},{"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":"从在本地将最近的 WAL 刷盘，到收到该备库已写入该 WAL（但尚未刷盘或应用）的通知之间经过的时间。如果该服务器被配置为同步备库，可用此值衡量在提交时 synchronous_commit 级别 remote_write 所导致的延迟。","documented":true,"documented_name":"write_lag","hidden":false,"name":"write_lag","not_null":false,"references":"","type":"interval","type_modifier":-1,"type_oid":1186,"zh_from":"same-version-manual"},{"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":"从在本地将最近的 WAL 刷盘，到收到该备库已写入该 WAL 并将其刷盘（但尚未应用）的通知之间经过的时间。如果该服务器被配置为同步备库，可用此值衡量在提交时 synchronous_commit 级别 on 所导致的延迟。","documented":true,"documented_name":"flush_lag","hidden":false,"name":"flush_lag","not_null":false,"references":"","type":"interval","type_modifier":-1,"type_oid":1186,"zh_from":"same-version-manual"},{"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":"从在本地将最近的 WAL 刷盘，到收到该备库已写入该 WAL、将其刷盘并应用的通知之间经过的时间。如果该服务器被配置为同步备库，可用此值衡量在提交时 synchronous_commit 级别 remote_apply 所导致的延迟。","documented":true,"documented_name":"replay_lag","hidden":false,"name":"replay_lag","not_null":false,"references":"","type":"interval","type_modifier":-1,"type_oid":1186,"zh_from":"same-version-manual"},{"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,"zh_from":"same-version-manual"},{"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":"该备库的同步状态。可能的值是：\n\nasync：该备库是异步的。 potential：该备库当前是异步的，但在当前某个同步备库失效时可能变为同步的。 sync：该备库是同步的。 quorum：该备库被视为法定人数同步复制的候选备库。","documented":true,"documented_name":"sync_state","hidden":false,"name":"sync_state","not_null":false,"references":"","type":"text","type_modifier":-1,"type_oid":25,"zh_from":"same-version-manual"},{"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,"zh_from":"same-version-manual"}],"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."}},"RequestedLocale":"en","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}
