[SCM] PostGIS branch stable-3.6 updated. 3.6.0rc2-3-gec3689daa

git at osgeo.org git at osgeo.org
Wed Aug 27 03:36:54 PDT 2025


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "PostGIS".

The branch, stable-3.6 has been updated
       via  ec3689daa2fa762e2383fae28cf91a0b2a6fe510 (commit)
      from  56081cadea74bed07ed1e19c63c9718b05a0b461 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit ec3689daa2fa762e2383fae28cf91a0b2a6fe510
Author: Sandro Santilli <strk at kbt.io>
Date:   Wed Aug 27 12:34:52 2025 +0200

    Add downgrade testing
    
    References #5977 in 3.6 branch (3.6.0dev)

diff --git a/utils/check_all_upgrades.sh b/utils/check_all_upgrades.sh
index 0670ab65d..db3ba0424 100755
--- a/utils/check_all_upgrades.sh
+++ b/utils/check_all_upgrades.sh
@@ -135,6 +135,21 @@ kept_label()
   return 0;
 }
 
+# Usage: compatible_from <label> <from>
+compatible_from()
+{
+  label=$1
+  from=$2
+  cmp=`semver_compare "${PGIS_MIN_VERSION}" "${from}"`
+  if test $cmp -gt 0; then
+    echo "SKIP: $label ($from older than ${PGIS_MIN_VERSION}, which is required to run in PostgreSQL ${PGVER})"
+    return 1
+  fi
+
+  return 0
+}
+
+# Usage: compatible_upgrade <label> <from> <to>
 compatible_upgrade()
 {
   label=$1
@@ -152,13 +167,32 @@ compatible_upgrade()
     echo "SKIP: $label ($to is not newer than $from)"
     return 1
   fi
-  cmp=`semver_compare "${PGIS_MIN_VERSION}" "${from}"`
-  if test $cmp -gt 0; then
-    echo "SKIP: $label ($from older than ${PGIS_MIN_VERSION}, which is required to run in PostgreSQL ${PGVER})"
+
+  if compatible_from $label $from; then
+    return 0
+  else
     return 1
   fi
+}
 
-  return 0
+check_downgrade()
+{
+  RUNTESTFLAGS="-v --extension --upgrade-path=${UPGRADE_PATH} ${USERTESTFLAGS}" \
+  unbuffer ${MAKE} -C ${REGDIR} check "TESTS=${SRCDIR}/regress/core/regress.sql" ${MAKE_ARGS} > ${TMPDIR}/log 2>&1
+  if test $? = 0; then
+    echo "FAIL: ${test_label} did not error out:"
+    tail ${TMPDIR}/log
+    failed
+  else
+    ERR=$( grep 'ERROR:.*Downgrade .* forbidden' ${TMPDIR}/log )
+    test -n "$ERR" && {
+      echo "PASS: ${test_label} gave $ERR"
+    } || {
+      echo "FAIL: ${test_label} gave some other error:"
+      tail ${TMPDIR}/log
+      failed
+    }
+  fi
 }
 
 report_missing_versions()
@@ -233,12 +267,26 @@ for EXT in ${INSTALLED_EXTENSIONS}; do #{
       continue;
     fi
     UPGRADE_PATH="${from_version}--${to_version_param}"
-    test_label="${EXT} extension upgrade ${UPGRADE_PATH}"
+
+    cmp=`semver_compare "${from_version}" "${to_version}"`
+    #echo "INFO: semver_compare ${from} ${to} returned $cmp"
+    if test $cmp -eq 0; then
+      echo "SKIP: ${from_version} -> ${to_version} (we won't test same-version upgrade/downgrade here)"
+      continue;
+    fi
+
+    if test $cmp -lt 0; then
+      test_label="${EXT} extension upgrade ${UPGRADE_PATH}"
+    else
+      test_label="${EXT} extension downgrade ${UPGRADE_PATH}"
+    fi
+
     if expr $to_version_param : ':auto' >/dev/null; then
       test_label="${test_label} ($to_version)"
     fi
+
     kept_label "${test_label}" || continue
-    compatible_upgrade "${test_label}" ${from_version} ${to_version} || continue
+
     path=$( psql -XAtc "
         SELECT path
         FROM pg_catalog.pg_extension_update_paths('${EXT}')
@@ -250,14 +298,30 @@ for EXT in ${INSTALLED_EXTENSIONS}; do #{
       MISSING_EXT_UPGRADES="${from_version} ${MISSING_EXT_UPGRADES}"
       continue
     fi
+
+    compatible_from "${test_label}" ${from_version} || continue
+
     echo "Testing ${test_label}"
-    RUNTESTFLAGS="-v --extension --upgrade-path=${UPGRADE_PATH} ${USERTESTFLAGS}" \
-    ${MAKE} -C ${REGDIR} check ${MAKE_ARGS} && {
-      echo "PASS: ${test_label}"
-    } || {
-      echo "FAIL: ${test_label}"
-      failed
-    }
+
+    if expr "${test_label}" : '^.*upgrade' > /dev/null; then
+      RUNTESTFLAGS="-v --extension --upgrade-path=${UPGRADE_PATH} ${USERTESTFLAGS}" \
+      ${MAKE} -C ${REGDIR} check ${MAKE_ARGS} && {
+        echo "PASS: ${test_label}"
+      } || {
+        echo "FAIL: ${test_label}"
+        failed
+      }
+    else
+      check_downgrade
+
+      test_label="${test_label} with standard-conforming-strings off"
+      echo "Testing ${test_label}"
+      USERTESTFLAGS="\
+        ${USERTESTFLAGS} \
+        --before-upgrade-script ${SRCDIR}/regress/hooks/standard-conforming-strings-off.sql \
+      " check_downgrade
+    fi
+
   done
 
   if ! kept_label "unpackaged"; then

-----------------------------------------------------------------------

Summary of changes:
 utils/check_all_upgrades.sh | 90 ++++++++++++++++++++++++++++++++++++++-------
 1 file changed, 77 insertions(+), 13 deletions(-)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list