summaryrefslogtreecommitdiffstats
path: root/doc/src/sgml/ref/checkpoint.sgml
blob: 28a1d717b87eb28fb8ff236cb8c3e8b890f8bf1d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<!--
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 <link linkend="predefined-roles-table"><literal>pg_checkpoint</literal></link>
   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>