↑↓ select ↵ open ⌫ change scope Open full search

PG.CENTER connects PostgreSQL documentation, reference, and ecosystem knowledge. Maintained by Pigsty.

Functions / System Administration Functions

pg_switch_wal

Read the PG 18 manual

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).

Reading PG 18current·documented in 11 of 27 versions, 10 to 20

Signatures & examples

pg_switch_wal () → pg_lsn
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.
Version history 2
  1. 12 → 13 changed
  2. 9.6 → 10 added

Definition snapshot: b7bd9cda · English manual source