Skip to content

Commit 9ba3915

Browse files
committed
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 47b3c26), 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
1 parent 99efd8d commit 9ba3915

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/bin/pg_upgrade/test.sh

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -84,14 +84,6 @@ if [ "$1" = '--install' ]; then
8484
SHLIB_PATH=$libdir:$SHLIB_PATH
8585
export SHLIB_PATH
8686
PATH=$libdir:$PATH
87-
88-
# We need to make it use psql from our temporary installation,
89-
# because otherwise the installcheck run below would try to
90-
# use psql from the proper installation directory, which might
91-
# be outdated or missing. But don't override anything else that's
92-
# already in EXTRA_REGRESS_OPTS.
93-
EXTRA_REGRESS_OPTS="$EXTRA_REGRESS_OPTS --bindir='$bindir'"
94-
export EXTRA_REGRESS_OPTS
9587
fi
9688

9789
: ${oldbindir=$bindir}
@@ -100,6 +92,14 @@ fi
10092
oldsrc=`cd "$oldsrc" && pwd`
10193
newsrc=`cd ../../.. && pwd`
10294

95+
# We need to make pg_regress use psql from the desired installation
96+
# (likely a temporary one), because otherwise the installcheck run
97+
# below would try to use psql from the proper installation directory
98+
# of the target version, which might be outdated or not exist. But
99+
# don't override anything else that's already in EXTRA_REGRESS_OPTS.
100+
EXTRA_REGRESS_OPTS="$EXTRA_REGRESS_OPTS --bindir='$oldbindir'"
101+
export EXTRA_REGRESS_OPTS
102+
103103
PATH=$bindir:$PATH
104104
export PATH
105105

0 commit comments

Comments
 (0)