From f916221df5652b95c402847905bdf48950b5b281 Mon Sep 17 00:00:00 2001 From: Andres Freund Date: Thu, 23 May 2019 14:46:52 -0700 Subject: [PATCH] pg_upgrade: Make test.sh's installcheck use to-be-upgraded version's bindir. On master (after 700538) the old version's installed psql was used - even when the old version might not actually be installed / might be installed into a temporary directory. As commonly the case when just executing make check for pg_upgrade, as $oldbindir is just the current version's $bindir. In the back branches, with --install specified, psql from the new version's temporary installation was used, without --install (e.g for NO_TEMP_INSTALL, cf 47b3c26642), the new version's installed psql was used (which might or might not exist). Author: Andres Freund Discussion: https://postgr.es/m/20190522175150.c26f4jkqytahajdg@alap3.anarazel.de --- src/bin/pg_upgrade/test.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/bin/pg_upgrade/test.sh b/src/bin/pg_upgrade/test.sh index be0055ee6b..fecc157bf0 100644 --- a/src/bin/pg_upgrade/test.sh +++ b/src/bin/pg_upgrade/test.sh @@ -76,6 +76,14 @@ temp_root=`pwd`/tmp_check oldsrc=`cd "$oldsrc" && pwd` newsrc=`cd ../../.. && pwd` +# We need to make pg_regress use psql from the desired installation +# (likely a temporary one), because otherwise the installcheck run +# below would try to use psql from the proper installation directory +# of the target version, which might be outdated or not exist. But +# don't override anything else that's already in EXTRA_REGRESS_OPTS. +EXTRA_REGRESS_OPTS="$EXTRA_REGRESS_OPTS --bindir='$oldbindir'" +export EXTRA_REGRESS_OPTS + # While in normal cases this will already be set up, adding bindir to # path allows test.sh to be invoked with different versions as # described in ./TESTING