此条目与较新PostgreSQL版本中已重命名的功能相关
pg_wal_replay_resume() 是一个系统函数,用于在先前调用 pg_wal_replay_pause() 或导致 WAL 重放暂停的恢复操作之后,恢复 WAL 文件的重放。
pg_wal_replay_resume() 在 PostgreSQL 9.1 中首次添加,当时名为 pg_xlog_replay_resume()。
用法
pg_wal_replay_resume() → void
变更历史
- PostgreSQL 10
- 重命名为
pg_wal_replay_resume()(提交 806091c9)
- 重命名为
- PostgreSQL 9.1
- 添加为
pg_xlog_replay_resume()(提交 8c6e3adb)
- 添加为
示例
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)
这会在 PostgreSQL 日志文件中生成类似以下的条目
[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();
参考资料
- PostgreSQL 文档: 恢复控制函数
