{"Entry":{"collection":"func","key":"pg-wal-lsn-diff","name":"pg_wal_lsn_diff","aliases":[],"metadata":{"changed_in":[],"changes":[{"descriptions_changed":false,"doc_overhaul":false,"from":"9.6","group_changed":null,"signatures":{"added":[],"removed":[]},"status":"added","to":"10"},{"descriptions_changed":false,"doc_overhaul":true,"from":"12","group_changed":null,"signatures":{"added":[],"removed":[]},"status":"changed","to":"13"},{"descriptions_changed":true,"doc_overhaul":false,"from":"13","group_changed":null,"signatures":{"added":[],"removed":[]},"status":"changed","to":"14"},{"descriptions_changed":true,"doc_overhaul":false,"from":"14","group_changed":null,"signatures":{"added":[],"removed":[]},"status":"changed","to":"15"},{"descriptions_changed":true,"doc_overhaul":false,"from":"15","group_changed":null,"signatures":{"added":[],"removed":[]},"status":"changed","to":"16"},{"descriptions_changed":true,"doc_overhaul":false,"from":"16","group_changed":null,"signatures":{"added":[],"removed":[]},"status":"changed","to":"17"},{"descriptions_changed":true,"doc_overhaul":false,"from":"17","group_changed":null,"signatures":{"added":[],"removed":[]},"status":"changed","to":"18"},{"descriptions_changed":true,"doc_overhaul":false,"from":"18","group_changed":null,"signatures":{"added":[],"removed":[]},"status":"changed","to":"19"},{"descriptions_changed":true,"doc_overhaul":false,"from":"19","group_changed":null,"signatures":{"added":[],"removed":[]},"status":"changed","to":"20"}],"content_hash":"17702c28dd195ff2a7f963e5ff2bc083c353c542133c81ccbaba958189919c17","derived_content_hash":"d82313fe43d49e89f50fffbb6ad903625c8eff08e519f5952765d5718aa27089","documentation_refresh":{"batch":"20261113","original_source_rev":"wiki-repair-20261023:bc6bb7bea55cade7525fcb1470f92cbae291a6457f054dd6d5c1a6cb5c017faa","versions":{"14":"14.25","15":"15.20","16":"16.16","17":"17.12","18":"18.7","19":"19rc2"}},"first_version":"10","group":"admin","group_label":"System Administration Functions","groups":["admin"],"imported_at":"2026-09-27T17:57:29.706653+08:00","last_version":"20","name":"pg_wal_lsn_diff","name_key":"pg_wal_lsn_diff","position":29113,"present_in":["10","11","12","13","14","15","16","17","18","19","20"],"repair_provenance":{"original_source_revision":"b7bd9cda","receipt_sha256":"bd14e9b81d717f6909bfe98912774b50bb6e34c4afc233118225a37eafc46557","repair":"wiki-repair-20261023"},"signature":"pg_wal_lsn_diff ( lsn1 pg_lsn, lsn2 pg_lsn ) → numeric","signature_count":1,"slug":"pg-wal-lsn-diff","source_rev":"wiki-repair-20261023:bc6bb7bea55cade7525fcb1470f92cbae291a6457f054dd6d5c1a6cb5c017faa","summary":"Calculates the difference in bytes (lsn1 - lsn2) between two write-ahead log locations.","summary_zh":""}},"Definition":{"Collection":"func","Key":"pg-wal-lsn-diff","SourceDatabase":"center","Version":"18","SourceTable":"func","SourceKey":"pg-wal-lsn-diff","SourceRevision":"wiki-repair-20261023:bc6bb7bea55cade7525fcb1470f92cbae291a6457f054dd6d5c1a6cb5c017faa","Facts":{"description":"Calculates the difference in bytes (lsn1 - lsn2) between two write-ahead log locations. This can be used with pg_stat_replication or some of the functions shown in Table 9.97 to get the replication lag.","description_html":"Calculates the difference in bytes (\u003cem class=\"parameter\"\u003e\u003ccode\u003elsn1\u003c/code\u003e\u003c/em\u003e - \u003cem class=\"parameter\"\u003e\u003ccode\u003elsn2\u003c/code\u003e\u003c/em\u003e) between two write-ahead log locations. This can be used with \u003ccode class=\"structname\"\u003epg_stat_replication\u003c/code\u003e or some of the functions shown in \u003ca href=\"/docs/18/functions-admin.html#FUNCTIONS-ADMIN-BACKUP-TABLE\" title=\"Table 9.97. Backup Control Functions\"\u003eTable 9.97\u003c/a\u003e to get the replication lag.","description_zh":"计算两个预写式日志位置之间的字节差（lsn1 - lsn2）。可以将它与 pg_stat_replication 或表 9.97 中的某些函数配合使用，以获取复制延迟。","description_zh_html":"计算两个预写式日志位置之间的字节差（\u003cem class=\"parameter\"\u003e\u003ccode\u003elsn1\u003c/code\u003e\u003c/em\u003e - \u003cem class=\"parameter\"\u003e\u003ccode\u003elsn2\u003c/code\u003e\u003c/em\u003e）。可以将它与 \u003ccode class=\"structname\"\u003epg_stat_replication\u003c/code\u003e 或\u003ca href=\"/docs/18/functions-admin.html#FUNCTIONS-ADMIN-BACKUP-TABLE\" title=\"表 9.97. 备份控制函数\"\u003e表 9.97\u003c/a\u003e 中的某些函数配合使用，以获取复制延迟。","doc":{"anchor":"FUNCTIONS-ADMIN-BACKUP-TABLE","file":"functions-admin.html","sha256":"885561d57facd49c33b44a50e320a002197d700d118784cc87d6410efadbd1f6","slug":"18"},"documentation_revision":{"inputs":[{"file":"functions-admin.html","kind":"same-version-reviewed-manual","locale":"en","sha256":"885561d57facd49c33b44a50e320a002197d700d118784cc87d6410efadbd1f6","version":"18.7"},{"file":"functions-admin.html","kind":"same-version-reviewed-manual","locale":"zh-Hans","sha256":"830e894d29fec30b7c350c915fcaed4a63b24d57f2c96150bf25fa07fb43849c","version":"18.7"}],"release":"18.7","runtime_remeasured":false,"source_revision":"pgdoc:b9f0e7232f60f380d642ac9b99226606c254b552"},"group":"admin","group_label":"系统管理函数","lang":"en","layout":"table-new","pages":["functions-admin.html"],"prose_only":false,"signatures":[{"description":"Calculates the difference in bytes (lsn1 - lsn2) between two write-ahead log locations. This can be used with pg_stat_replication or some of the functions shown in Table 9.97 to get the replication lag.","description_html":"Calculates the difference in bytes (\u003cem class=\"parameter\"\u003e\u003ccode\u003elsn1\u003c/code\u003e\u003c/em\u003e - \u003cem class=\"parameter\"\u003e\u003ccode\u003elsn2\u003c/code\u003e\u003c/em\u003e) between two write-ahead log locations. This can be used with \u003ccode class=\"structname\"\u003epg_stat_replication\u003c/code\u003e or some of the functions shown in \u003ca href=\"/docs/18/functions-admin.html#FUNCTIONS-ADMIN-BACKUP-TABLE\" title=\"Table 9.97. Backup Control Functions\"\u003eTable 9.97\u003c/a\u003e to get the replication lag.","description_zh":"计算两个预写式日志位置之间的字节差（lsn1 - lsn2）。可以将它与 pg_stat_replication 或表 9.97 中的某些函数配合使用，以获取复制延迟。","description_zh_html":"计算两个预写式日志位置之间的字节差（\u003cem class=\"parameter\"\u003e\u003ccode\u003elsn1\u003c/code\u003e\u003c/em\u003e - \u003cem class=\"parameter\"\u003e\u003ccode\u003elsn2\u003c/code\u003e\u003c/em\u003e）。可以将它与 \u003ccode class=\"structname\"\u003epg_stat_replication\u003c/code\u003e 或\u003ca href=\"/docs/18/functions-admin.html#FUNCTIONS-ADMIN-BACKUP-TABLE\" title=\"表 9.97. 备份控制函数\"\u003e表 9.97\u003c/a\u003e 中的某些函数配合使用，以获取复制延迟。","examples":[],"html":"\u003ccode class=\"function\"\u003epg_wal_lsn_diff\u003c/code\u003e ( \u003cem class=\"parameter\"\u003e\u003ccode\u003elsn1\u003c/code\u003e\u003c/em\u003e \u003ccode class=\"type\"\u003epg_lsn\u003c/code\u003e, \u003cem class=\"parameter\"\u003e\u003ccode\u003elsn2\u003c/code\u003e\u003c/em\u003e \u003ccode class=\"type\"\u003epg_lsn\u003c/code\u003e ) → \u003ccode class=\"returnvalue\"\u003enumeric\u003c/code\u003e","returns":"numeric","text":"pg_wal_lsn_diff ( lsn1 pg_lsn, lsn2 pg_lsn ) → numeric","zh_from":"same-version-manual"}],"translation_provenance":{"inputs":[{"kind":"current-pgdoc-translation","path":"/Users/vonng/pgsty/pgdoc/zh/18/html/functions-admin.html","sha256":"b4fab9daceb7883fd75b32b6eb5398f2bbbfbbed5c83d1b2bf99cc8d842cdaf7"}],"kind":"same-version-pgdoc","locale":"zh-Hans","source_revision":"b1b500221dbe5437cfca004d6b04d3f6e422765d","version":"18"},"zh_from":"same-version-manual"},"ManualEvidence":{"doc":{"anchor":"FUNCTIONS-ADMIN-BACKUP-TABLE","file":"functions-admin.html","sha256":"885561d57facd49c33b44a50e320a002197d700d118784cc87d6410efadbd1f6","slug":"18"}},"MeasuredEvidence":{}},"Text":{"Collection":"func","Key":"pg-wal-lsn-diff","SourceDatabase":"center","Version":"18","Locale":"en","Title":"pg_wal_lsn_diff","Summary":"Calculates the difference in bytes (lsn1 - lsn2) between two write-ahead log locations. This can be used with pg_stat_replication or some of the functions shown in Table 9.97 to get the replication lag.","BodyHTML":"Calculates the difference in bytes (\u003cem\u003e\u003ccode\u003elsn1\u003c/code\u003e\u003c/em\u003e - \u003cem\u003e\u003ccode\u003elsn2\u003c/code\u003e\u003c/em\u003e) between two write-ahead log locations. This can be used with \u003ccode\u003epg_stat_replication\u003c/code\u003e or some of the functions shown in \u003ca href=\"/docs/18/functions-admin.html#FUNCTIONS-ADMIN-BACKUP-TABLE\" rel=\"nofollow\"\u003eTable 9.97\u003c/a\u003e to get the replication lag.","SourceRevision":"wiki-repair-20261023:bc6bb7bea55cade7525fcb1470f92cbae291a6457f054dd6d5c1a6cb5c017faa","ContentHash":"e7bb7c175fc5b09d6b73ea0649007d3a98415f6aa7f1b10a892822bb68ee2362","Payload":{"description":"Calculates the difference in bytes (lsn1 - lsn2) between two write-ahead log locations. This can be used with pg_stat_replication or some of the functions shown in Table 9.97 to get the replication lag.","description_html":"Calculates the difference in bytes (\u003cem class=\"parameter\"\u003e\u003ccode\u003elsn1\u003c/code\u003e\u003c/em\u003e - \u003cem class=\"parameter\"\u003e\u003ccode\u003elsn2\u003c/code\u003e\u003c/em\u003e) between two write-ahead log locations. This can be used with \u003ccode class=\"structname\"\u003epg_stat_replication\u003c/code\u003e or some of the functions shown in \u003ca href=\"/docs/18/functions-admin.html#FUNCTIONS-ADMIN-BACKUP-TABLE\" title=\"Table 9.97. Backup Control Functions\"\u003eTable 9.97\u003c/a\u003e to get the replication lag.","signatures":[{"description":"Calculates the difference in bytes (lsn1 - lsn2) between two write-ahead log locations. This can be used with pg_stat_replication or some of the functions shown in Table 9.97 to get the replication lag.","description_html":"Calculates the difference in bytes (\u003cem class=\"parameter\"\u003e\u003ccode\u003elsn1\u003c/code\u003e\u003c/em\u003e - \u003cem class=\"parameter\"\u003e\u003ccode\u003elsn2\u003c/code\u003e\u003c/em\u003e) between two write-ahead log locations. This can be used with \u003ccode class=\"structname\"\u003epg_stat_replication\u003c/code\u003e or some of the functions shown in \u003ca href=\"/docs/18/functions-admin.html#FUNCTIONS-ADMIN-BACKUP-TABLE\" title=\"Table 9.97. Backup Control Functions\"\u003eTable 9.97\u003c/a\u003e to get the replication lag.","description_zh":"计算两个预写式日志位置之间的字节差（lsn1 - lsn2）。可以将它与 pg_stat_replication 或表 9.97 中的某些函数配合使用，以获取复制延迟。","description_zh_html":"计算两个预写式日志位置之间的字节差（\u003cem class=\"parameter\"\u003e\u003ccode\u003elsn1\u003c/code\u003e\u003c/em\u003e - \u003cem class=\"parameter\"\u003e\u003ccode\u003elsn2\u003c/code\u003e\u003c/em\u003e）。可以将它与 \u003ccode class=\"structname\"\u003epg_stat_replication\u003c/code\u003e 或\u003ca href=\"/docs/18/functions-admin.html#FUNCTIONS-ADMIN-BACKUP-TABLE\" title=\"表 9.97. 备份控制函数\"\u003e表 9.97\u003c/a\u003e 中的某些函数配合使用，以获取复制延迟。","examples":[],"html":"\u003ccode class=\"function\"\u003epg_wal_lsn_diff\u003c/code\u003e ( \u003cem class=\"parameter\"\u003e\u003ccode\u003elsn1\u003c/code\u003e\u003c/em\u003e \u003ccode class=\"type\"\u003epg_lsn\u003c/code\u003e, \u003cem class=\"parameter\"\u003e\u003ccode\u003elsn2\u003c/code\u003e\u003c/em\u003e \u003ccode class=\"type\"\u003epg_lsn\u003c/code\u003e ) → \u003ccode class=\"returnvalue\"\u003enumeric\u003c/code\u003e","returns":"numeric","text":"pg_wal_lsn_diff ( lsn1 pg_lsn, lsn2 pg_lsn ) → numeric","zh_from":"same-version-manual"}]}},"RequestedLocale":"en","Fallback":false,"Versions":["10","11","12","13","14","15","16","17","18","19","20"],"Locales":["en","zh-Hans"],"Signatures":[{"Version":"18","Ordinal":0,"Hash":"c9c2216ee48a7ded6a3556aad302d1b6b51c96093a74c4e121a9741c763452be","Text":"pg_wal_lsn_diff ( lsn1 pg_lsn, lsn2 pg_lsn ) → numeric","Returns":"numeric","Payload":{"description":"Calculates the difference in bytes (lsn1 - lsn2) between two write-ahead log locations. This can be used with pg_stat_replication or some of the functions shown in Table 9.97 to get the replication lag.","description_html":"Calculates the difference in bytes (\u003cem class=\"parameter\"\u003e\u003ccode\u003elsn1\u003c/code\u003e\u003c/em\u003e - \u003cem class=\"parameter\"\u003e\u003ccode\u003elsn2\u003c/code\u003e\u003c/em\u003e) between two write-ahead log locations. This can be used with \u003ccode class=\"structname\"\u003epg_stat_replication\u003c/code\u003e or some of the functions shown in \u003ca href=\"/docs/18/functions-admin.html#FUNCTIONS-ADMIN-BACKUP-TABLE\" title=\"Table 9.97. Backup Control Functions\"\u003eTable 9.97\u003c/a\u003e to get the replication lag.","description_zh":"计算两个预写式日志位置之间的字节差（lsn1 - lsn2）。可以将它与 pg_stat_replication 或表 9.97 中的某些函数配合使用，以获取复制延迟。","description_zh_html":"计算两个预写式日志位置之间的字节差（\u003cem class=\"parameter\"\u003e\u003ccode\u003elsn1\u003c/code\u003e\u003c/em\u003e - \u003cem class=\"parameter\"\u003e\u003ccode\u003elsn2\u003c/code\u003e\u003c/em\u003e）。可以将它与 \u003ccode class=\"structname\"\u003epg_stat_replication\u003c/code\u003e 或\u003ca href=\"/docs/18/functions-admin.html#FUNCTIONS-ADMIN-BACKUP-TABLE\" title=\"表 9.97. 备份控制函数\"\u003e表 9.97\u003c/a\u003e 中的某些函数配合使用，以获取复制延迟。","examples":[],"html":"\u003ccode class=\"function\"\u003epg_wal_lsn_diff\u003c/code\u003e ( \u003cem class=\"parameter\"\u003e\u003ccode\u003elsn1\u003c/code\u003e\u003c/em\u003e \u003ccode class=\"type\"\u003epg_lsn\u003c/code\u003e, \u003cem class=\"parameter\"\u003e\u003ccode\u003elsn2\u003c/code\u003e\u003c/em\u003e \u003ccode class=\"type\"\u003epg_lsn\u003c/code\u003e ) → \u003ccode class=\"returnvalue\"\u003enumeric\u003c/code\u003e","returns":"numeric","text":"pg_wal_lsn_diff ( lsn1 pg_lsn, lsn2 pg_lsn ) → numeric","zh_from":"same-version-manual"}}],"Spellings":null,"SQLState":null,"Evidence":null}
