1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-30 11:03:19 +03:00

Named restore points in recovery. Users can record named points, then

new recovery.conf parameter recovery_target_name allows PITR to
specify named points as recovery targets.

Jaime Casanova, reviewed by Euler Taveira de Oliveira, plus minor edits
This commit is contained in:
Simon Riggs
2011-02-08 19:39:08 +00:00
parent 8c6e3adbf7
commit c016ce7281
9 changed files with 209 additions and 17 deletions

View File

@ -1086,9 +1086,10 @@ restore_command = 'cp /mnt/server/archivedir/%f %p'
the junior DBA dropped your main transaction table), just specify the
required stopping point in <filename>recovery.conf</>. You can specify
the stop point, known as the <quote>recovery target</>, either by
date/time or by completion of a specific transaction ID. As of this
writing only the date/time option is very usable, since there are no tools
to help you identify with any accuracy which transaction ID to use.
date/time, named restore point or by completion of a specific transaction
ID. As of this writing only the date/time and named restore point options
are very usable, since there are no tools to help you identify with any
accuracy which transaction ID to use.
</para>
<note>

View File

@ -13914,6 +13914,9 @@ SELECT set_config('log_statement_stats', 'off', false);
<indexterm>
<primary>backup</primary>
</indexterm>
<indexterm>
<primary>pg_create_restore_point</primary>
</indexterm>
<indexterm>
<primary>pg_current_xlog_insert_location</primary>
</indexterm>
@ -13951,6 +13954,13 @@ SELECT set_config('log_statement_stats', 'off', false);
</thead>
<tbody>
<row>
<entry>
<literal><function>pg_create_restore_point(<parameter>name</> <type>text</>)</function></literal>
</entry>
<entry><type>text</type></entry>
<entry>Create a named point for performing restore (restricted to superusers)</entry>
</row>
<row>
<entry>
<literal><function>pg_current_xlog_insert_location()</function></literal>

View File

@ -143,6 +143,25 @@ restore_command = 'copy "C:\\server\\archivedir\\%f" "%p"' # Windows
<title>Recovery Target Settings</title>
<variablelist>
<varlistentry id="recovery-target-name" xreflabel="recovery_target_name">
<term><varname>recovery_target_name</varname>
(<type>string</type>)
</term>
<indexterm>
<primary><varname>recovery_target_name</> recovery parameter</primary>
</indexterm>
<listitem>
<para>
This parameter specifies the named restore point, created with
<function>pg_create_restore_point()</> to which recovery will proceed.
At most one of <varname>recovery_target_name</>,
<xref linkend="recovery-target-time"> or
<xref linkend="recovery-target-xid"> can be specified. The default is to
recover to the end of the WAL log.
</para>
</listitem>
</varlistentry>
<varlistentry id="recovery-target-time" xreflabel="recovery_target_time">
<term><varname>recovery_target_time</varname>
(<type>timestamp</type>)
@ -154,7 +173,8 @@ restore_command = 'copy "C:\\server\\archivedir\\%f" "%p"' # Windows
<para>
This parameter specifies the time stamp up to which recovery
will proceed.
At most one of <varname>recovery_target_time</> and
At most one of <varname>recovery_target_time</>,
<xref linkend="recovery-target-name"> or
<xref linkend="recovery-target-xid"> can be specified.
The default is to recover to the end of the WAL log.
The precise stopping point is also influenced by
@ -176,7 +196,8 @@ restore_command = 'copy "C:\\server\\archivedir\\%f" "%p"' # Windows
start, transactions can complete in a different numeric order.
The transactions that will be recovered are those that committed
before (and optionally including) the specified one.
At most one of <varname>recovery_target_xid</> and
At most one of <varname>recovery_target_xid</>,
<xref linkend="recovery-target-name"> or
<xref linkend="recovery-target-time"> can be specified.
The default is to recover to the end of the WAL log.
The precise stopping point is also influenced by