From 79ad8fc5f857ed38057f482fc022bf157175c4d8 Mon Sep 17 00:00:00 2001 From: Robert Haas Date: Thu, 24 Feb 2011 18:58:38 -0500 Subject: [PATCH] Named restore point improvements. 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 | 10 ++++++++++ src/backend/access/transam/xlog.c | 4 ++++ 2 files changed, 14 insertions(+) diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml index 736eb67dff..c363949b7c 100644 --- a/doc/src/sgml/func.sgml +++ b/doc/src/sgml/func.sgml @@ -14069,6 +14069,16 @@ postgres=# select pg_start_backup('label_goes_here'); of the transaction log file currently in use. + + 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 + 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. + + pg_current_xlog_location displays the current transaction log write location in the same format used by the above functions. Similarly, diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c index 3ba1f29197..b4eb4ac2cc 100644 --- a/src/backend/access/transam/xlog.c +++ b/src/backend/access/transam/xlog.c @@ -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; } -- 2.40.0