Home Explore Blog CI



postgresql

doc/src/sgml/ref/checkpoint.sgml
0fe5a6a6593e46513e3bbb39e78cf879d2dc3e63f78482a10000000300000732
<!--
doc/src/sgml/ref/checkpoint.sgml
PostgreSQL documentation
-->

<refentry id="sql-checkpoint">
 <indexterm zone="sql-checkpoint">
  <primary>CHECKPOINT</primary>
 </indexterm>

 <refmeta>
  <refentrytitle>CHECKPOINT</refentrytitle>
  <manvolnum>7</manvolnum>
  <refmiscinfo>SQL - Language Statements</refmiscinfo>
 </refmeta>

 <refnamediv>
  <refname>CHECKPOINT</refname>
  <refpurpose>force a write-ahead log checkpoint</refpurpose>
 </refnamediv>

 <refsynopsisdiv>
<synopsis>
CHECKPOINT
</synopsis>
 </refsynopsisdiv>

 <refsect1>
  <title>Description</title>

  <para>
   A checkpoint is a point in the write-ahead log sequence at which
   all data files have been updated to reflect the information in the
   log.  All data files will be flushed to disk.  Refer to
   <xref linkend="wal-configuration"/> for more details about what happens
   during a checkpoint.
  </para>

  <para>
   The <command>CHECKPOINT</command> command forces an immediate
   checkpoint when the command is issued, without waiting for a
   regular checkpoint scheduled by the system (controlled by the settings in
   <xref linkend="runtime-config-wal-checkpoints"/>).
   <command>CHECKPOINT</command> is not intended for use during normal
   operation.
  </para>

  <para>
   If executed during recovery, the <command>CHECKPOINT</command> command
   will force a restartpoint (see <xref linkend="wal-configuration"/>)
   rather than writing a new checkpoint.
  </para>

  <para>
   Only superusers or users with the privileges of
   the <xref linkend="predefined-role-pg-checkpoint"/>
   role can call <command>CHECKPOINT</command>.
  </para>
 </refsect1>

 <refsect1>
  <title>Compatibility</title>

  <para>
   The <command>CHECKPOINT</command> command is a
   <productname>PostgreSQL</productname> language extension.
  </para>
 </refsect1>
</refentry>

Chunks
e8699dc1 (1st chunk of `doc/src/sgml/ref/checkpoint.sgml`)
Title: CHECKPOINT: Force a Write-Ahead Log Checkpoint
Summary
The CHECKPOINT command forces an immediate checkpoint, ensuring all data files are updated to reflect the information in the write-ahead log and flushed to disk. It's not for normal operation and requires superuser or pg_checkpoint role privileges. During recovery, it forces a restartpoint. CHECKPOINT is a PostgreSQL extension.