aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2015-05-16 00:40:18 -0400
committerBruce Momjian <bruce@momjian.us>2015-05-16 00:40:18 -0400
commit4c5e060049a3714dd27b7f4732fe922090edea69 (patch)
tree723fbde0d16b416a0b789e1a98fef5eaa27edcad /src
parentfb694d959c97c912b49ec47326e6a05a8c0da11d (diff)
downloadpostgresql-4c5e060049a3714dd27b7f4732fe922090edea69.tar.gz
postgresql-4c5e060049a3714dd27b7f4732fe922090edea69.zip
pg_upgrade: force timeline 1 in the new cluster
Previously, this prevented promoted standby servers from being upgraded because of a missing WAL history file. (Timeline 1 doesn't need a history file, and we don't copy WAL files anyway.) Report by Christian Echerer(?), Alexey Klyukin Backpatch through 9.0
Diffstat (limited to 'src')
-rw-r--r--src/bin/pg_upgrade/pg_upgrade.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/bin/pg_upgrade/pg_upgrade.c b/src/bin/pg_upgrade/pg_upgrade.c
index fbccc2e8304..cc81fa0bb25 100644
--- a/src/bin/pg_upgrade/pg_upgrade.c
+++ b/src/bin/pg_upgrade/pg_upgrade.c
@@ -473,8 +473,9 @@ copy_clog_xlog_xid(void)
/* now reset the wal archives in the new cluster */
prep_status("Resetting WAL archives");
exec_prog(UTILITY_LOG_FILE, NULL, true,
- "\"%s/pg_resetxlog\" -l %s \"%s\"", new_cluster.bindir,
- old_cluster.controldata.nextxlogfile,
+ /* use timeline 1 to match controldata and no WAL history file */
+ "\"%s/pg_resetxlog\" -l 00000001%s \"%s\"", new_cluster.bindir,
+ old_cluster.controldata.nextxlogfile + 8,
new_cluster.pgdata);
check_ok();
}