]> granicus.if.org Git - postgresql/commitdiff
Add value 'current' for recovery_target_timeline
authorPeter Eisentraut <peter@eisentraut.org>
Fri, 11 Jan 2019 09:25:06 +0000 (10:25 +0100)
committerPeter Eisentraut <peter@eisentraut.org>
Fri, 11 Jan 2019 10:02:03 +0000 (11:02 +0100)
This value represents the default behavior of using the current
timeline.  Previously, this was represented by an empty string.

(Before the removal of recovery.conf, this setting could not be chosen
explicitly but was used when recovery_target_timeline was not
mentioned at all.)

Discussion: https://www.postgresql.org/message-id/flat/6dd2c23a-4162-8469-410f-bfe146e28c0c@2ndquadrant.com/
Reviewed-by: David Steele <david@pgmasters.net>
Reviewed-by: Michael Paquier <michael@paquier.xyz>
doc/src/sgml/config.sgml
src/backend/utils/misc/guc.c
src/backend/utils/misc/postgresql.conf.sample

index 5d723f392121c2cbc4baeea775da79605780e262..f64402adbe11a8b3493365fd92bc09b1911b323d 100644 (file)
@@ -3350,9 +3350,11 @@ restore_command = 'copy "C:\\server\\archivedir\\%f" "%p"'  # Windows
       </term>
       <listitem>
        <para>
-        Specifies recovering into a particular timeline.  The default is
-        to recover along the same timeline that was current when the
-        base backup was taken. Setting this to <literal>latest</literal> recovers
+        Specifies recovering into a particular timeline.  The value can be a
+        numeric timeline ID or a special value.  The value
+        <literal>current</literal> recovers along the same timeline that was
+        current when the base backup was taken.  That is the default.  The
+        value <literal>latest</literal> recovers
         to the latest timeline found in the archive, which is useful in
         a standby server. Other than that you only need to set this parameter
         in complex re-recovery situations, where you need to return to
index f81e0424e7242c663cc6c5846784086f5e8379a0..7eda7fdef9afd313c368f087fe236783b5906f31 100644 (file)
@@ -3387,7 +3387,7 @@ static struct config_string ConfigureNamesString[] =
                        NULL
                },
                &recovery_target_timeline_string,
-               "",
+               "current",
                check_recovery_target_timeline, assign_recovery_target_timeline, NULL
        },
 
@@ -11031,7 +11031,7 @@ check_recovery_target_timeline(char **newval, void **extra, GucSource source)
        RecoveryTargetTimeLineGoal rttg = RECOVERY_TARGET_TIMELINE_CONTROLFILE;
        RecoveryTargetTimeLineGoal *myextra;
 
-       if (strcmp(*newval, "") == 0)
+       if (strcmp(*newval, "current") == 0)
                rttg = RECOVERY_TARGET_TIMELINE_CONTROLFILE;
        else if (strcmp(*newval, "latest") == 0)
                rttg = RECOVERY_TARGET_TIMELINE_LATEST;
index 1fa02d2c938129fb68dcb59208b7530d52026dda..f7c1dee240228de12c16084816f2374469b4c184 100644 (file)
                                # just after the specified recovery target (on)
                                # just before the recovery target (off)
                                # (change requires restart)
-#recovery_target_timeline = '' # unset means read from control file (default),
-                               # or set to 'latest' or timeline ID
+#recovery_target_timeline = 'current'  # 'current', 'latest', or timeline ID
                                # (change requires restart)
 #recovery_target_action = 'pause'      # 'pause', 'promote', 'shutdown'
                                # (change requires restart)