Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit ff85306

Browse files
committed
Add value 'current' for recovery_target_timeline
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>
1 parent 43cbeda commit ff85306

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

doc/src/sgml/config.sgml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3350,9 +3350,11 @@ restore_command = 'copy "C:\\server\\archivedir\\%f" "%p"' # Windows
33503350
</term>
33513351
<listitem>
33523352
<para>
3353-
Specifies recovering into a particular timeline. The default is
3354-
to recover along the same timeline that was current when the
3355-
base backup was taken. Setting this to <literal>latest</literal> recovers
3353+
Specifies recovering into a particular timeline. The value can be a
3354+
numeric timeline ID or a special value. The value
3355+
<literal>current</literal> recovers along the same timeline that was
3356+
current when the base backup was taken. That is the default. The
3357+
value <literal>latest</literal> recovers
33563358
to the latest timeline found in the archive, which is useful in
33573359
a standby server. Other than that you only need to set this parameter
33583360
in complex re-recovery situations, where you need to return to

src/backend/utils/misc/guc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3387,7 +3387,7 @@ static struct config_string ConfigureNamesString[] =
33873387
NULL
33883388
},
33893389
&recovery_target_timeline_string,
3390-
"",
3390+
"current",
33913391
check_recovery_target_timeline, assign_recovery_target_timeline, NULL
33923392
},
33933393

@@ -11031,7 +11031,7 @@ check_recovery_target_timeline(char **newval, void **extra, GucSource source)
1103111031
RecoveryTargetTimeLineGoal rttg = RECOVERY_TARGET_TIMELINE_CONTROLFILE;
1103211032
RecoveryTargetTimeLineGoal *myextra;
1103311033

11034-
if (strcmp(*newval, "") == 0)
11034+
if (strcmp(*newval, "current") == 0)
1103511035
rttg = RECOVERY_TARGET_TIMELINE_CONTROLFILE;
1103611036
else if (strcmp(*newval, "latest") == 0)
1103711037
rttg = RECOVERY_TARGET_TIMELINE_LATEST;

src/backend/utils/misc/postgresql.conf.sample

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,8 +261,7 @@
261261
# just after the specified recovery target (on)
262262
# just before the recovery target (off)
263263
# (change requires restart)
264-
#recovery_target_timeline = '' # unset means read from control file (default),
265-
# or set to 'latest' or timeline ID
264+
#recovery_target_timeline = 'current' # 'current', 'latest', or timeline ID
266265
# (change requires restart)
267266
#recovery_target_action = 'pause' # 'pause', 'promote', 'shutdown'
268267
# (change requires restart)

0 commit comments

Comments
 (0)