OSDN Git Service

Named restore point improvements.
authorRobert Haas <rhaas@postgresql.org>
Thu, 24 Feb 2011 23:58:38 +0000 (18:58 -0500)
committerRobert Haas <rhaas@postgresql.org>
Fri, 25 Feb 2011 00:02:00 +0000 (19:02 -0500)
Emit a log message when creating a named restore point, and improve
documentation for pg_create_restore_point().

Euler Taveira de Oliveira,  per suggestions from Thom Brown, with some
additional wordsmithing by me.

doc/src/sgml/func.sgml
src/backend/access/transam/xlog.c

index 736eb67..c363949 100644 (file)
@@ -14070,6 +14070,16 @@ postgres=# select pg_start_backup('label_goes_here');
    </para>
 
    <para>
+    <function>pg_create_restore_point</> creates a named transaction log
+    record that can be used as recovery target, and returns the corresponding
+    transaction log location.  The given name can then be used with
+    <xref linkend="recovery-target-name"> to specify the point up to which
+    recovery will proceed.  Avoid creating multiple restore points with the
+    same name, since recovery will stop at the first one whose name matches
+    the recovery target.
+   </para>
+
+   <para>
     <function>pg_current_xlog_location</> displays the current transaction log write
     location in the same format used by the above functions.  Similarly,
     <function>pg_current_xlog_insert_location</> displays the current transaction log
index 3ba1f29..b4eb4ac 100644 (file)
@@ -8144,6 +8144,10 @@ XLogRestorePoint(const char *rpName)
 
        RecPtr = XLogInsert(RM_XLOG_ID, XLOG_RESTORE_POINT, &rdata);
 
+       ereport(LOG,
+                       (errmsg("restore point \"%s\" created at %X/%X",
+                                       rpName, RecPtr.xlogid, RecPtr.xrecoff)));
+
        return RecPtr;
 }