DBAtlas · Database operations atlas

Switch the WAL segment

PostgreSQLWAL & Checkpoint

Command

SELECT pg_switch_wal();

What it does

Closes the current WAL segment and switches to a new one; triggers archiving.

When to use it

To produce an archive file or force out WAL after a backup.

Caution

Before PostgreSQL 10 it was pg_switch_xlog().

Open in DBAtlas →

Related