CHECKPOINT
CHECKPOINT — force a write-ahead log checkpoint
Synopsis
CHECKPOINT [ (option[, ...] ) ] whereoptioncan be one of: FLUSH_UNLOGGED [boolean] MODE { FAST | SPREAD }
Description
A checkpoint is a point in the write-ahead log sequence at which
all data files for permanent relations have been updated to reflect the
information in the log. All data for permanent relation files will be
flushed to disk. Dirty buffers of unlogged relations are not flushed unless
FLUSH_UNLOGGED is specified. Refer to
Section 28.5 for more details about what happens
during a checkpoint.
By default, the CHECKPOINT command forces a fast
checkpoint when the command is issued, without waiting for a
regular checkpoint scheduled by the system (controlled by the settings in
Section 19.5.2).
To request the checkpoint be spread over a longer interval, set the
MODE option to SPREAD.
CHECKPOINT is not intended for use during normal
operation.
The server may consolidate concurrently requested checkpoints. Such consolidated requests will contain a combined set of options. For example, if one session requests a fast checkpoint and another requests a spread checkpoint, the server may combine those requests and perform one fast checkpoint.
If executed during recovery, the CHECKPOINT command
will force a restartpoint (see Section 28.5)
rather than writing a new checkpoint.
Only superusers or users with the privileges of
the pg_checkpoint
role can call CHECKPOINT.
Parameters
FLUSH_UNLOGGEDNormally,
CHECKPOINTdoes not flush dirty buffers of unlogged relations. This option, which is disabled by default, enables flushing unlogged relations to disk.MODEWhen set to
FAST, which is the default, the requested checkpoint will be completed as fast as possible, which may result in a significantly higher rate of I/O during the checkpoint.MODEcan also be set toSPREADto request the checkpoint be spread over a longer interval (controlled via the settings in Section 19.5.2), like a regular checkpoint scheduled by the system. This can reduce the rate of I/O during the checkpoint.booleanSpecifies whether the selected option should be turned on or off. You can write
TRUE,ON, or1to enable the option, andFALSE,OFF, or0to disable it. Thebooleanvalue can also be omitted, in which caseTRUEis assumed.
Compatibility
The CHECKPOINT command is a
PostgreSQL language extension.
Report a documentation issue
Read the upstream documentation. For corrections, first check the current manual.