[postgis-tickets] [SCM] PostGIS branch stable-3.2 updated. 3.2.2-7-g60244502e
git at osgeo.org
git at osgeo.org
Fri Aug 5 22:08:22 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, stable-3.2 has been updated
via 60244502e3ee1cf2c56b67be334c678ab28f0b27 (commit)
from 80ff12916c20ad5b59a7151f803a867c4f876395 (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 60244502e3ee1cf2c56b67be334c678ab28f0b27
Author: Sandro Santilli <strk at kbt.io>
Date: Sat Aug 6 07:07:48 2022 +0200
Guard against downgrades
References #5202 in 3.2 branch (3.2.3dev)
diff --git a/utils/postgis_proc_upgrade.pl b/utils/postgis_proc_upgrade.pl
index 6173af8e2..cbaf06e36 100755
--- a/utils/postgis_proc_upgrade.pl
+++ b/utils/postgis_proc_upgrade.pl
@@ -719,6 +719,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/postgis_proc_upgrade.pl | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
hooks/post-receive
--
PostGIS
More information about the postgis-tickets
mailing list