]> granicus.if.org Git - postgresql/blobdiff - src/backend/access/transam/xlogarchive.c
Fix initialization of fake LSN for unlogged relations
[postgresql] / src / backend / access / transam / xlogarchive.c
index 9a21f006d1df1eeddc819e1587a0da19d025176d..e14bcf8ea6092fb40a7618ba1a6b76ba4411bbad 100644 (file)
@@ -64,6 +64,13 @@ RestoreArchivedFile(char *path, const char *xlogfname,
        XLogRecPtr      restartRedoPtr;
        TimeLineID      restartTli;
 
+       /*
+        * Ignore restore_command when not in archive recovery (meaning
+        * we are in crash recovery).
+        */
+       if (!ArchiveRecoveryRequested)
+               goto not_available;
+
        /* In standby mode, restore_command might not be supplied */
        if (recoveryRestoreCommand == NULL || strcmp(recoveryRestoreCommand, "") == 0)
                goto not_available;