mirror of
https://github.com/postgres/postgres.git
synced 2025-07-14 08:21:07 +03:00
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
This commit is contained in:
@ -382,12 +382,11 @@ check_bin_dir(ClusterInfo *cluster)
|
|||||||
validate_exec(cluster->bindir, "pg_ctl");
|
validate_exec(cluster->bindir, "pg_ctl");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Fetch the binary versions after checking for the existence of pg_ctl,
|
* Fetch the binary version after checking for the existence of pg_ctl.
|
||||||
* this gives a correct error if the binary used itself for the version
|
* This way we report a useful error if the pg_ctl binary used for version
|
||||||
* fetching is broken.
|
* fetching is missing/broken.
|
||||||
*/
|
*/
|
||||||
get_bin_version(&old_cluster);
|
get_bin_version(cluster);
|
||||||
get_bin_version(&new_cluster);
|
|
||||||
|
|
||||||
/* pg_resetxlog has been renamed to pg_resetwal in version 10 */
|
/* pg_resetxlog has been renamed to pg_resetwal in version 10 */
|
||||||
if (GET_MAJOR_VERSION(cluster->bin_version) < 1000)
|
if (GET_MAJOR_VERSION(cluster->bin_version) < 1000)
|
||||||
|
Reference in New Issue
Block a user