pg_upgrade_test.patch
text/x-patch
Filename: pg_upgrade_test.patch
Type: text/x-patch
Part: 0
Patch
Same data as JSON:
GET /api/v1/attachments/:id/patch
the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes.
API reference →
Format: unified
| File | + | − |
|---|---|---|
| contrib/pg_upgrade/test.sh | 34 | 7 |
diff --git a/contrib/pg_upgrade/test.sh b/contrib/pg_upgrade/test.sh
index 31e30af..fc2304a 100644
--- a/contrib/pg_upgrade/test.sh
+++ b/contrib/pg_upgrade/test.sh
@@ -43,13 +43,23 @@ if [ "$1" = '--install' ]; then
export EXTRA_REGRESS_OPTS
fi
-: ${oldbindir=$bindir}
-
: ${oldsrc=../..}
-oldsrc=`cd "$oldsrc" && pwd`
-newsrc=`cd ../.. && pwd`
-PATH=$bindir:$PATH
+if [ `uname -a | sed 's/.* //'` = Msys ] ; then
+ cp $libdir/libpq.dll $bindir
+ osbindir=`cd $bindir && pwd`
+ bindir=`cd $bindir && pwd -W`
+ oldsrc=`cd "$oldsrc" && pwd -W`
+ newsrc=`cd ../.. && pwd -W`
+else
+ osbindir=$bindir
+ oldsrc=`cd "$oldsrc" && pwd`
+ newsrc=`cd ../.. && pwd`
+fi
+
+: ${oldbindir=$bindir}
+
+PATH=$osbindir:$PATH
export PATH
PGDATA=$temp_root/data
@@ -104,10 +114,19 @@ mv "${PGDATA}" "${PGDATA}.old"
initdb
+if [ `uname -a | sed 's/.* //'` = Msys ] ; then
+ PGDATA=`cd $PGDATA && pwd -W`
+fi
+
pg_upgrade -d "${PGDATA}.old" -D "${PGDATA}" -b "$oldbindir" -B "$bindir"
pg_ctl start -l "$logdir/postmaster2.log" -w
-sh ./analyze_new_cluster.sh
+
+if [ `uname -a | sed 's/.* //'` = Msys ] ; then
+ cmd /c analyze_new_cluster.bat
+else
+ sh ./analyze_new_cluster.sh
+fi
pg_dumpall >"$temp_root"/dump2.sql || pg_dumpall2_status=$?
pg_ctl -m fast stop
if [ -n "$pg_dumpall2_status" ]; then
@@ -115,7 +134,15 @@ if [ -n "$pg_dumpall2_status" ]; then
exit 1
fi
-sh ./delete_old_cluster.sh
+if [ `uname -a | sed 's/.* //'` = Msys ] ; then
+ sed -i -e 's,/,\\,g' -e 's,\\s\\q ,/s/q ,' delete_old_cluster.bat 2>/dev/null
+ chmod +w delete_old_cluster.bat
+ cmd /c delete_old_cluster.bat
+ dos2unix "$temp_root"/dump1.sql >/dev/null
+ dos2unix "$temp_root"/dump2.sql >/dev/null
+else
+ sh ./delete_old_cluster.sh
+fi
if diff -q "$temp_root"/dump1.sql "$temp_root"/dump2.sql; then
echo PASSED