Skip to content

Commit 9be95ef

Browse files
committed
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
1 parent 20d9ada commit 9be95ef

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/bin/pg_upgrade/exec.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -382,12 +382,11 @@ check_bin_dir(ClusterInfo *cluster)
382382
validate_exec(cluster->bindir, "pg_ctl");
383383

384384
/*
385-
* Fetch the binary versions after checking for the existence of pg_ctl,
386-
* this gives a correct error if the binary used itself for the version
387-
* fetching is broken.
385+
* Fetch the binary version after checking for the existence of pg_ctl.
386+
* This way we report a useful error if the pg_ctl binary used for version
387+
* fetching is missing/broken.
388388
*/
389-
get_bin_version(&old_cluster);
390-
get_bin_version(&new_cluster);
389+
get_bin_version(cluster);
391390

392391
/* pg_resetxlog has been renamed to pg_resetwal in version 10 */
393392
if (GET_MAJOR_VERSION(cluster->bin_version) < 1000)

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