pg_wal_replay_resume()

A function for resuming replay of WAL files

pg_wal_replay_resume() is a system function for resuming replay of WAL files following a preceding call to pg_wal_replay_pause(), or a recovery action which results in WAL replay being paused.

pg_wal_replay_resume() was added in PostgreSQL 9.1 as pg_xlog_replay_resume().

Usage

pg_wal_replay_resume() → void

Change history

Examples

Basic usage of pg_wal_replay_resume():

postgres=# SELECT pg_wal_replay_pause();
 pg_wal_replay_pause
---------------------

(1 row)

postgres=# SELECT pg_get_wal_replay_pause_state(); -- PostgreSQL 14 and later
 pg_get_wal_replay_pause_state
-------------------------------
 paused
(1 row)

postgres=# SELECT pg_wal_replay_resume();
 pg_wal_replay_resume
----------------------

(1 row)

This generates entries like the following in the PostgreSQL logfile:

[2021-04-06 15:14:24 UTC] psql postgres postgres LOG:  00000: statement: SELECT pg_wal_replay_pause();
[2021-04-06 15:14:24 UTC]    LOG:  00000: recovery has paused
[2021-04-06 15:14:24 UTC]    HINT:  Execute pg_wal_replay_resume() to continue.
[2021-04-06 15:14:34 UTC] psql postgres postgres LOG:  00000: statement: SELECT pg_get_wal_replay_pause_state();
[2021-04-06 15:14:58 UTC] psql postgres postgres LOG:  00000: statement: SELECT pg_wal_replay_resume();

Categories

Replication, System function, WAL

See also

pg_wal_replay_pause(), pg_get_wal_replay_pause_state()