diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2017-11-09 11:30:30 -0500 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2017-11-09 11:30:36 -0500 |
commit | 115a7075633899408fc1ab85f3bc2e5deeaa5e45 (patch) | |
tree | 5710ef91f82c141aad415d4061137835dff69079 /src | |
parent | 1772c5c6eee7f3eeaa0e485f67e9cd92f165e1cc (diff) | |
download | postgresql-115a7075633899408fc1ab85f3bc2e5deeaa5e45.tar.gz postgresql-115a7075633899408fc1ab85f3bc2e5deeaa5e45.zip |
Fix bogus logic for checking executables' versions within pg_upgrade.
Somebody messed up a refactoring here. As it stood, we'd check pg_ctl's
--version output twice for each cluster. Worse, the first check for the
new cluster's version happened before we'd done any validate_exec checks
there, breaking the check ordering the code intended.
A. Akenteva
Discussion: https://postgr.es/m/f9266a85d918a3cf3a386b5148aee666@postgrespro.ru
Diffstat (limited to 'src')
-rw-r--r-- | src/bin/pg_upgrade/exec.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/bin/pg_upgrade/exec.c b/src/bin/pg_upgrade/exec.c index 59ddc16d6b8..810a5a0c3c5 100644 --- a/src/bin/pg_upgrade/exec.c +++ b/src/bin/pg_upgrade/exec.c @@ -382,12 +382,11 @@ check_bin_dir(ClusterInfo *cluster) validate_exec(cluster->bindir, "pg_ctl"); /* - * Fetch the binary versions after checking for the existence of pg_ctl, - * this gives a correct error if the binary used itself for the version - * fetching is broken. + * Fetch the binary version after checking for the existence of pg_ctl. + * This way we report a useful error if the pg_ctl binary used for version + * fetching is missing/broken. */ - get_bin_version(&old_cluster); - get_bin_version(&new_cluster); + get_bin_version(cluster); /* pg_resetxlog has been renamed to pg_resetwal in version 10 */ if (GET_MAJOR_VERSION(cluster->bin_version) < 1000) |