{"Entry":{"collection":"func","key":"pg-switch-wal","name":"pg_switch_wal","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"}],"content_hash":"f628e6d1a0e1bef1e8979c7b37ca4cf0b99ffa91e963501f52fc6ca0343fc9b0","first_version":"10","group":"admin","group_label":"System Administration Functions","groups":["admin"],"imported_at":"2026-09-27T17:57:29.675474+08:00","last_version":"20","name":"pg_switch_wal","name_key":"pg_switch_wal","position":29102,"present_in":["10","11","12","13","14","15","16","17","18","19","20"],"signature":"pg_switch_wal () → pg_lsn","signature_count":1,"slug":"pg-switch-wal","source_rev":"b7bd9cda","summary":"Forces the server to switch to a new write-ahead log file, which allows the current file to be archived (assuming you are using continuous archiving).","summary_zh":""}},"Definition":{"Collection":"func","Key":"pg-switch-wal","SourceDatabase":"center","Version":"18","SourceTable":"func","SourceKey":"pg-switch-wal","SourceRevision":"b7bd9cda","Facts":{"description":"Forces the server to switch to a new write-ahead log file, which allows the current file to be archived (assuming you are using continuous archiving). The result is the ending write-ahead log location plus 1 within the just-completed write-ahead log file. If there has been no write-ahead log activity since the last write-ahead log switch, pg_switch_wal does nothing and returns the start location of the write-ahead log file currently in use.","description_html":"Forces the server to switch to a new write-ahead log file, which allows the current file to be archived (assuming you are using continuous archiving). The result is the ending write-ahead log location plus 1 within the just-completed write-ahead log file. If there has been no write-ahead log activity since the last write-ahead log switch, \u003ccode class=\"function\"\u003epg_switch_wal\u003c/code\u003e does nothing and returns the start location of the write-ahead log file currently in use.","description_zh":"","description_zh_html":"","doc":{"anchor":"FUNCTIONS-ADMIN-BACKUP-TABLE","file":"functions-admin.html","slug":"18"},"group":"admin","group_label":"System Administration Functions","lang":"en","layout":"table-new","pages":["functions-admin.html"],"prose_only":false,"signatures":[{"description":"Forces the server to switch to a new write-ahead log file, which allows the current file to be archived (assuming you are using continuous archiving). The result is the ending write-ahead log location plus 1 within the just-completed write-ahead log file. If there has been no write-ahead log activity since the last write-ahead log switch, pg_switch_wal does nothing and returns the start location of the write-ahead log file currently in use.","description_html":"Forces the server to switch to a new write-ahead log file, which allows the current file to be archived (assuming you are using continuous archiving). The result is the ending write-ahead log location plus 1 within the just-completed write-ahead log file. If there has been no write-ahead log activity since the last write-ahead log switch, \u003ccode class=\"function\"\u003epg_switch_wal\u003c/code\u003e does nothing and returns the start location of the write-ahead log file currently in use.","description_zh":"","description_zh_html":"","examples":[],"html":"\u003ccode class=\"function\"\u003epg_switch_wal\u003c/code\u003e () → \u003ccode class=\"returnvalue\"\u003epg_lsn\u003c/code\u003e","returns":"pg_lsn","text":"pg_switch_wal () → pg_lsn","zh_from":""}],"zh_from":""},"ManualEvidence":{"doc":{"anchor":"FUNCTIONS-ADMIN-BACKUP-TABLE","file":"functions-admin.html","slug":"18"}},"MeasuredEvidence":{}},"Text":{"Collection":"func","Key":"pg-switch-wal","SourceDatabase":"pgweb","Version":"18","Locale":"zh-Hans","Title":"pg_switch_wal","Summary":"强制服务器切换到新的预写式日志文件，使当前文件可以归档（假设正在使用连续归档）。返回值是刚完成的预写式日志文件中的结束预写式日志位置加 1。如果自上次切换预写式日志以来没有发生任何预写式日志活动，pg_switch_wal不执行任何操作，并返回当前使用的预写式日志文件的起始位置。","BodyHTML":"强制服务器切换到新的预写式日志文件，使当前文件可以归档（假设正在使用连续归档）。返回值是刚完成的预写式日志文件中的结束预写式日志位置加 1。如果自上次切换预写式日志以来没有发生任何预写式日志活动，\u003ccode\u003epg_switch_wal\u003c/code\u003e不执行任何操作，并返回当前使用的预写式日志文件的起始位置。\u003cpre\u003epg_switch_wal () → pg_lsn\u003c/pre\u003e强制服务器切换到新的预写式日志文件，使当前文件可以归档（假设正在使用连续归档）。返回值是刚完成的预写式日志文件中的结束预写式日志位置加 1。如果自上次切换预写式日志以来没有发生任何预写式日志活动，\u003ccode\u003epg_switch_wal\u003c/code\u003e不执行任何操作，并返回当前使用的预写式日志文件的起始位置。","SourceRevision":"ca936764","ContentHash":"c14a1a13139ce8aa3462dbec2e2efa0c1fad344072a3c24a78150fafc3809e76","Payload":{"description_zh":"强制服务器切换到新的预写式日志文件，使当前文件可以归档（假设正在使用连续归档）。返回值是刚完成的预写式日志文件中的结束预写式日志位置加 1。如果自上次切换预写式日志以来没有发生任何预写式日志活动，pg_switch_wal不执行任何操作，并返回当前使用的预写式日志文件的起始位置。","description_zh_html":"强制服务器切换到新的预写式日志文件，使当前文件可以归档（假设正在使用连续归档）。返回值是刚完成的预写式日志文件中的结束预写式日志位置加 1。如果自上次切换预写式日志以来没有发生任何预写式日志活动，\u003ccode class=\"function\"\u003epg_switch_wal\u003c/code\u003e不执行任何操作，并返回当前使用的预写式日志文件的起始位置。","signatures":[{"description_zh":"强制服务器切换到新的预写式日志文件，使当前文件可以归档（假设正在使用连续归档）。返回值是刚完成的预写式日志文件中的结束预写式日志位置加 1。如果自上次切换预写式日志以来没有发生任何预写式日志活动，pg_switch_wal不执行任何操作，并返回当前使用的预写式日志文件的起始位置。","description_zh_html":"强制服务器切换到新的预写式日志文件，使当前文件可以归档（假设正在使用连续归档）。返回值是刚完成的预写式日志文件中的结束预写式日志位置加 1。如果自上次切换预写式日志以来没有发生任何预写式日志活动，\u003ccode class=\"function\"\u003epg_switch_wal\u003c/code\u003e不执行任何操作，并返回当前使用的预写式日志文件的起始位置。","returns":"pg_lsn","text":"pg_switch_wal () → pg_lsn","zh_from":"doc"}],"zh_from":"doc"}},"RequestedLocale":"zh-Hans","Fallback":false,"Versions":["10","11","12","13","14","15","16","17","18","19","20"],"Locales":["en","zh-Hans"],"Signatures":[{"Version":"18","Ordinal":0,"Hash":"adc8663562dd29306465ac19d306d930754d5ab6a9dead15ea24726843e1b517","Text":"pg_switch_wal () → pg_lsn","Returns":"pg_lsn","Payload":{"description":"Forces the server to switch to a new write-ahead log file, which allows the current file to be archived (assuming you are using continuous archiving). The result is the ending write-ahead log location plus 1 within the just-completed write-ahead log file. If there has been no write-ahead log activity since the last write-ahead log switch, pg_switch_wal does nothing and returns the start location of the write-ahead log file currently in use.","description_html":"Forces the server to switch to a new write-ahead log file, which allows the current file to be archived (assuming you are using continuous archiving). The result is the ending write-ahead log location plus 1 within the just-completed write-ahead log file. If there has been no write-ahead log activity since the last write-ahead log switch, \u003ccode class=\"function\"\u003epg_switch_wal\u003c/code\u003e does nothing and returns the start location of the write-ahead log file currently in use.","description_zh":"","description_zh_html":"","examples":[],"html":"\u003ccode class=\"function\"\u003epg_switch_wal\u003c/code\u003e () → \u003ccode class=\"returnvalue\"\u003epg_lsn\u003c/code\u003e","returns":"pg_lsn","text":"pg_switch_wal () → pg_lsn","zh_from":""}}],"Spellings":null,"SQLState":null,"Evidence":null}
