mirror of
https://git.postgresql.org/git/postgresql.git
synced 2025-03-19 20:00:51 +08:00
If multiple recovery_targets are specified, use the latest one.
The docs say that only one of recovery_target_xid, recovery_target_time, or recovery_target_name can be specified. But the code actually did something different, so that a name overrode time, and xid overrode both time and name. Now the target specified last takes effect, whether it's an xid, time or name. With this patch, we still accept multiple recovery_target settings, even though docs say that only one can be specified. It's a general property of the recovery.conf file parser that you if you specify the same option twice, the last one takes effect, like with postgresql.conf.
This commit is contained in:
parent
847e46abc9
commit
815d71deed
@ -5402,13 +5402,6 @@ readRecoveryCommandFile(void)
|
|||||||
}
|
}
|
||||||
else if (strcmp(item->name, "recovery_target_time") == 0)
|
else if (strcmp(item->name, "recovery_target_time") == 0)
|
||||||
{
|
{
|
||||||
/*
|
|
||||||
* if recovery_target_xid or recovery_target_name specified, then
|
|
||||||
* this overrides recovery_target_time
|
|
||||||
*/
|
|
||||||
if (recoveryTarget == RECOVERY_TARGET_XID ||
|
|
||||||
recoveryTarget == RECOVERY_TARGET_NAME)
|
|
||||||
continue;
|
|
||||||
recoveryTarget = RECOVERY_TARGET_TIME;
|
recoveryTarget = RECOVERY_TARGET_TIME;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -5425,12 +5418,6 @@ readRecoveryCommandFile(void)
|
|||||||
}
|
}
|
||||||
else if (strcmp(item->name, "recovery_target_name") == 0)
|
else if (strcmp(item->name, "recovery_target_name") == 0)
|
||||||
{
|
{
|
||||||
/*
|
|
||||||
* if recovery_target_xid specified, then this overrides
|
|
||||||
* recovery_target_name
|
|
||||||
*/
|
|
||||||
if (recoveryTarget == RECOVERY_TARGET_XID)
|
|
||||||
continue;
|
|
||||||
recoveryTarget = RECOVERY_TARGET_NAME;
|
recoveryTarget = RECOVERY_TARGET_NAME;
|
||||||
|
|
||||||
recoveryTargetName = pstrdup(item->value);
|
recoveryTargetName = pstrdup(item->value);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user