CHECKPOINT
Forces a checkpoint for the current database by flushing dirty pages, making the required WAL durable, persisting the commit log, and publishing the redo point in the control file. The mechanism may remove WAL segments before the new recovery point when it is safe to do so.
CHECKPOINT;
The command does not change logical data or commit/abort transactions. It can
only be executed by an administrator while the session is idle, outside a
BEGIN/COMMIT block.
Relevant errors:
- SQLSTATE
42501: the session lacks administrator privilege; - SQLSTATE
25001: an explicit transaction is open; - SQLSTATE
XX000: WAL, data, or control-file persistence failed.
Manual checkpoints are maintenance operations and may produce I/O and latency. The server also runs checkpoints according to its policy; this command only forces an immediate checkpoint for the current database.