On ons, 2011-04-27 at 18:14 -0400, Noah Misch wrote:
> Enthusiastic +1 for this concept.  There's at least one rough edge: it fails 
> if
> you have another postmaster running on port 5432.

This has now been addressed: pg_upgrade accepts PGPORT settings.
Attached is a slightly updated patch runs the test suite with a port of
65432, which you can override by setting PGPORT yourself.

Anyway, is this something that people want in the repository?  It's not
as polished as the pg_regress business, but it is definitely helpful.

diff --git i/contrib/pg_upgrade/Makefile w/contrib/pg_upgrade/Makefile
index 8f3fd7c..9ec7bc0 100644
--- i/contrib/pg_upgrade/Makefile
+++ w/contrib/pg_upgrade/Makefile
@@ -21,3 +21,6 @@ top_builddir = ../..
 include $(top_builddir)/src/Makefile.global
 include $(top_srcdir)/contrib/contrib-global.mk
 endif
+
+check: test.sh
+	MAKE=$(MAKE) bindir=$(bindir) $(SHELL) $<
diff --git i/contrib/pg_upgrade/test.sh w/contrib/pg_upgrade/test.sh
index e69de29..c675f26 100644
--- i/contrib/pg_upgrade/test.sh
+++ w/contrib/pg_upgrade/test.sh
@@ -0,0 +1,41 @@
+set -eux
+
+: ${MAKE=make}
+: ${PGPORT=65432}
+export PGPORT
+
+temp_root=$PWD/tmp_check
+temp_install=$temp_root/install
+bindir=$temp_install/$bindir
+PATH=$bindir:$PATH
+export PATH
+
+PGDATA=$temp_root/data
+export PGDATA
+rm -rf "$PGDATA" "$PGDATA".old
+
+logdir=$PWD/log
+rm -rf "$logdir"
+mkdir "$logdir"
+
+$MAKE -C ../.. install DESTDIR="$temp_install" 2>&1 | tee "$logdir/install.log"
+$MAKE -C ../pg_upgrade_support install DESTDIR="$temp_install" 2>&1 | tee -a "$logdir/install.log"
+$MAKE -C . install DESTDIR="$temp_install" 2>&1 | tee -a "$logdir/install.log"
+
+initdb 2>&1 | tee "$logdir/initdb1.log"
+pg_ctl start -l "$logdir/postmaster1.log" -w
+$MAKE -C ../.. installcheck 2>&1 | tee "$logdir/installcheck.log"
+pg_dumpall >"$temp_root"/dump1.sql
+pg_ctl -m fast stop
+
+mv "${PGDATA}" "${PGDATA}.old"
+
+initdb 2>&1 | tee "$logdir/initdb2.log"
+
+pg_upgrade -d "${PGDATA}.old" -D "${PGDATA}" -b "$bindir" -B "$bindir"
+
+pg_ctl start -l "$logdir/postmaster2.log" -w
+pg_dumpall >"$temp_root"/dump2.sql
+pg_ctl -m fast stop
+
+diff -q "$temp_root"/dump1.sql "$temp_root"/dump2.sql
-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to