postgresql/doc/src/sgml/ref/checkpoint.sgml

65 lines
1.7 KiB
Plaintext
Raw Normal View History

2010-09-20 22:08:53 +02:00
<!-- doc/src/sgml/ref/checkpoint.sgml -->
<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
2005-01-04 01:39:53 +01:00
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>
2001-01-27 11:19:52 +01:00
Allow read only connections during recovery, known as Hot Standby. Enabled by recovery_connections = on (default) and forcing archive recovery using a recovery.conf. Recovery processing now emulates the original transactions as they are replayed, providing full locking and MVCC behaviour for read only queries. Recovery must enter consistent state before connections are allowed, so there is a delay, typically short, before connections succeed. Replay of recovering transactions can conflict and in some cases deadlock with queries during recovery; these result in query cancellation after max_standby_delay seconds have expired. Infrastructure changes have minor effects on normal running, though introduce four new types of WAL record. New test mode "make standbycheck" allows regression tests of static command behaviour on a standby server while in recovery. Typical and extreme dynamic behaviours have been checked via code inspection and manual testing. Few port specific behaviours have been utilised, though primary testing has been on Linux only so far. This commit is the basic patch. Additional changes will follow in this release to enhance some aspects of behaviour, notably improved handling of conflicts, deadlock detection and query cancellation. Changes to VACUUM FULL are also required. Simon Riggs, with significant and lengthy review by Heikki Linnakangas, including streamlined redesign of snapshot creation and two-phase commit. Important contributions from Florian Pflug, Mark Kirkwood, Merlin Moncure, Greg Stark, Gianni Ciolli, Gabriele Bartolini, Hannu Krosing, Robert Haas, Tatsuo Ishii, Hiroyuki Yamada plus support and feedback from many other community members.
2009-12-19 02:32:45 +01:00
<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.
Allow read only connections during recovery, known as Hot Standby. Enabled by recovery_connections = on (default) and forcing archive recovery using a recovery.conf. Recovery processing now emulates the original transactions as they are replayed, providing full locking and MVCC behaviour for read only queries. Recovery must enter consistent state before connections are allowed, so there is a delay, typically short, before connections succeed. Replay of recovering transactions can conflict and in some cases deadlock with queries during recovery; these result in query cancellation after max_standby_delay seconds have expired. Infrastructure changes have minor effects on normal running, though introduce four new types of WAL record. New test mode "make standbycheck" allows regression tests of static command behaviour on a standby server while in recovery. Typical and extreme dynamic behaviours have been checked via code inspection and manual testing. Few port specific behaviours have been utilised, though primary testing has been on Linux only so far. This commit is the basic patch. Additional changes will follow in this release to enhance some aspects of behaviour, notably improved handling of conflicts, deadlock detection and query cancellation. Changes to VACUUM FULL are also required. Simon Riggs, with significant and lengthy review by Heikki Linnakangas, including streamlined redesign of snapshot creation and two-phase commit. Important contributions from Florian Pflug, Mark Kirkwood, Merlin Moncure, Greg Stark, Gianni Ciolli, Gabriele Bartolini, Hannu Krosing, Robert Haas, Tatsuo Ishii, Hiroyuki Yamada plus support and feedback from many other community members.
2009-12-19 02:32:45 +01:00
</para>
2001-01-27 11:19:52 +01:00
<para>
Only superusers can call <command>CHECKPOINT</command>.
2001-01-27 11:19:52 +01:00
</para>
</refsect1>
<refsect1>
<title>Compatibility</title>
<para>
The <command>CHECKPOINT</command> command is a
<productname>PostgreSQL</productname> language extension.
</para>
</refsect1>
</refentry>