aboutsummaryrefslogtreecommitdiff
path: root/src/bin/pg_upgrade/test.sh
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/pg_upgrade/test.sh')
-rw-r--r--src/bin/pg_upgrade/test.sh11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/bin/pg_upgrade/test.sh b/src/bin/pg_upgrade/test.sh
index 6430610d488..10a28d8133c 100644
--- a/src/bin/pg_upgrade/test.sh
+++ b/src/bin/pg_upgrade/test.sh
@@ -39,14 +39,14 @@ testhost=`uname -s | sed 's/^MSYS/MINGW/'`
case $testhost in
MINGW*)
LISTEN_ADDRESSES="localhost"
+ PG_REGRESS_SOCKET_DIR=""
PGHOST=localhost
;;
*)
LISTEN_ADDRESSES=""
# Select a socket directory. The algorithm is from the "configure"
# script; the outcome mimics pg_regress.c:make_temp_sockdir().
- PGHOST=$PG_REGRESS_SOCK_DIR
- if [ "x$PGHOST" = x ]; then
+ if [ x"$PG_REGRESS_SOCKET_DIR" = x ]; then
set +e
dir=`(umask 077 &&
mktemp -d /tmp/pg_upgrade_check-XXXXXX) 2>/dev/null`
@@ -59,14 +59,15 @@ case $testhost in
fi
fi
set -e
- PGHOST=$dir
- trap 'rm -rf "$PGHOST"' 0
+ PG_REGRESS_SOCKET_DIR=$dir
+ trap 'rm -rf "$PG_REGRESS_SOCKET_DIR"' 0
trap 'exit 3' 1 2 13 15
fi
+ PGHOST=$PG_REGRESS_SOCKET_DIR
;;
esac
-POSTMASTER_OPTS="-F -c listen_addresses=\"$LISTEN_ADDRESSES\" -k \"$PGHOST\""
+POSTMASTER_OPTS="-F -c listen_addresses=\"$LISTEN_ADDRESSES\" -k \"$PG_REGRESS_SOCKET_DIR\""
export PGHOST
# don't rely on $PWD here, as old shells don't set it