aboutsummaryrefslogtreecommitdiff
path: root/src/backend/access/transam/timeline.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/access/transam/timeline.c')
-rw-r--r--src/backend/access/transam/timeline.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/backend/access/transam/timeline.c b/src/backend/access/transam/timeline.c
index ad4f3162c53..51b37ca8f8c 100644
--- a/src/backend/access/transam/timeline.c
+++ b/src/backend/access/transam/timeline.c
@@ -41,6 +41,28 @@
#include "storage/fd.h"
/*
+ * Copies all timeline history files with id's between 'begin' and 'end'
+ * from archive to pg_xlog.
+ */
+void
+restoreTimeLineHistoryFiles(TimeLineID begin, TimeLineID end)
+{
+ char path[MAXPGPATH];
+ char histfname[MAXFNAMELEN];
+ TimeLineID tli;
+
+ for (tli = begin; tli < end; tli++)
+ {
+ if (tli == 1)
+ continue;
+
+ TLHistoryFileName(histfname, tli);
+ if (RestoreArchivedFile(path, histfname, "RECOVERYHISTORY", 0, false))
+ KeepFileRestoredFromArchive(path, histfname);
+ }
+}
+
+/*
* Try to read a timeline's history file.
*
* If successful, return the list of component TLIs (the given TLI followed by