]> granicus.if.org Git - postgresql/commitdiff
Prevent creation of postmaster's TCP socket during pg_upgrade testing.
authorTom Lane <tgl@sss.pgh.pa.us>
Thu, 3 Jan 2013 23:34:51 +0000 (18:34 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Thu, 3 Jan 2013 23:34:51 +0000 (18:34 -0500)
On non-Windows machines, we use the Unix socket for connections to test
postmasters, so there is no need to create a TCP socket.  Furthermore,
doing so causes failures due to port conflicts if two builds are carried
out concurrently on one machine.  (If the builds are done in different
chroots, which is standard practice at least in Red Hat distros, there
is no risk of conflict on the Unix socket.)  Suppressing the TCP socket
by setting listen_addresses to empty has long been standard practice
for pg_regress, and pg_upgrade knows about this too ... but pg_upgrade's
test.sh didn't get the memo.

Back-patch to 9.2, and also sync the 9.2 version of the script with HEAD
as much as practical.

contrib/pg_upgrade/test.sh

index 10b61573a30e6a2b5cbef69dd8fa2d5572f3dc5b..7b87784149b7e6e1af937da26433e521d6168ad0 100644 (file)
@@ -17,6 +17,13 @@ export PGPORT
 
 testhost=`uname -s`
 
+case $testhost in
+       MINGW*) LISTEN_ADDRESSES="localhost" ;;
+       *)              LISTEN_ADDRESSES="" ;;
+esac
+
+POSTMASTER_OPTS="-F -c listen_addresses=$LISTEN_ADDRESSES"
+
 temp_root=$PWD/tmp_check
 
 if [ "$1" = '--install' ]; then
@@ -75,7 +82,7 @@ mkdir "$logdir"
 set -x
 
 $oldbindir/initdb -N
-$oldbindir/pg_ctl start -l "$logdir/postmaster1.log" -o '-F' -w
+$oldbindir/pg_ctl start -l "$logdir/postmaster1.log" -o "$POSTMASTER_OPTS" -w
 if "$MAKE" -C "$oldsrc" installcheck; then
        pg_dumpall -f "$temp_root"/dump1.sql || pg_dumpall1_status=$?
        if [ "$newsrc" != "$oldsrc" ]; then
@@ -118,7 +125,7 @@ initdb -N
 
 pg_upgrade -d "${PGDATA}.old" -D "${PGDATA}" -b "$oldbindir" -B "$bindir"
 
-pg_ctl start -l "$logdir/postmaster2.log" -o '-F' -w
+pg_ctl start -l "$logdir/postmaster2.log" -o "$POSTMASTER_OPTS" -w
 
 case $testhost in
        MINGW*) cmd /c analyze_new_cluster.bat ;;