Skip to content

Commit 815d71d

Browse files
committed
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.
1 parent 847e46a commit 815d71d

File tree

1 file changed

+0
-13
lines changed
  • src/backend/access/transam

1 file changed

+0
-13
lines changed

src/backend/access/transam/xlog.c

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5402,13 +5402,6 @@ readRecoveryCommandFile(void)
54025402
}
54035403
else if (strcmp(item->name, "recovery_target_time") == 0)
54045404
{
5405-
/*
5406-
* if recovery_target_xid or recovery_target_name specified, then
5407-
* this overrides recovery_target_time
5408-
*/
5409-
if (recoveryTarget == RECOVERY_TARGET_XID ||
5410-
recoveryTarget == RECOVERY_TARGET_NAME)
5411-
continue;
54125405
recoveryTarget = RECOVERY_TARGET_TIME;
54135406

54145407
/*
@@ -5425,12 +5418,6 @@ readRecoveryCommandFile(void)
54255418
}
54265419
else if (strcmp(item->name, "recovery_target_name") == 0)
54275420
{
5428-
/*
5429-
* if recovery_target_xid specified, then this overrides
5430-
* recovery_target_name
5431-
*/
5432-
if (recoveryTarget == RECOVERY_TARGET_XID)
5433-
continue;
54345421
recoveryTarget = RECOVERY_TARGET_NAME;
54355422

54365423
recoveryTargetName = pstrdup(item->value);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy