[postgis-tickets] [SCM] PostGIS branch master updated. 3.3.0beta2-38-g497e79349

git at osgeo.org git at osgeo.org
Fri Aug 5 22:06:56 PDT 2022


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, master has been updated
       via  497e793493ccf96492665cbeab7482484e3f2a36 (commit)
      from  2f08c4f1e916a0ff6412d4ee0980377e74e61d01 (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 497e793493ccf96492665cbeab7482484e3f2a36
Author: Sandro Santilli <strk at kbt.io>
Date:   Sat Aug 6 07:06:02 2022 +0200

    Guard against downgrades
    
    References #5202 in master branch (3.3.0dev)

diff --git a/utils/create_upgrade.pl b/utils/create_upgrade.pl
index dfa429dd2..2bd235f45 100755
--- a/utils/create_upgrade.pl
+++ b/utils/create_upgrade.pl
@@ -769,6 +769,24 @@ BEGIN
         SELECT into old_scripts MODULE_scripts_installed();
     END;
     SELECT into new_scripts 'NEWVERSION';
+
+    -- Guard against downgrade
+    IF
+       pg_catalog.string_to_array(
+            pg_catalog.regexp_replace(new_scripts, '(dev|alpha|beta)[0-9]*', ''),
+            '.'
+        )::int[]
+            <
+        pg_catalog.string_to_array(
+            pg_catalog.regexp_replace(old_scripts, '(dev|alpha|beta)[0-9]*', ''),
+            '.'
+        )::int[]
+    THEN
+        RAISE EXCEPTION 'Downgrade of MODULE from version % to version % is forbidden', old_scripts, new_scripts;
+    END IF;
+
+
+    -- Check for hard-upgrade being required
     SELECT into old_maj pg_catalog.substring(old_scripts, 1, 1);
     SELECT into new_maj pg_catalog.substring(new_scripts, 1, 1);
 

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

Summary of changes:
 utils/create_upgrade.pl | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list