[postgis-tickets] [SCM] PostGIS branch stable-3.3 updated. 3.3.1-2-g0783b8b57

git at osgeo.org git at osgeo.org
Sat Sep 17 13:18:11 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.3 has been updated
       via  0783b8b57f2d44fc1a123bfe831a763c6a06890a (commit)
      from  f38b40a9dba61c9644ac291d998f22cf7846792c (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 0783b8b57f2d44fc1a123bfe831a763c6a06890a
Author: Sandro Santilli <strk at kbt.io>
Date:   Fri Sep 16 19:07:25 2022 +0200

    Drop downgrade protection from postgis_extensions_upgrade()
    
    This is best done from within upgrade scripts themselves, which
    is done from 3.3.0 version onward

diff --git a/postgis/postgis.sql.in b/postgis/postgis.sql.in
index 2c69ac5d6..88a246d33 100644
--- a/postgis/postgis.sql.in
+++ b/postgis/postgis.sql.in
@@ -3055,29 +3055,24 @@ BEGIN
 			-- force an update regardless if at target version, no downgrade allowed
 			IF (SELECT usesuper FROM pg_user WHERE usename = CURRENT_USER)
 						AND pg_catalog.substring(target_version, '[0-9]+\.[0-9]+\.[0-9]+')
-								>= pg_catalog.substring(rec.installed_version, '[0-9]+\.[0-9]+\.[0-9]+') THEN
-					sql = format(
-						'UPDATE pg_catalog.pg_extension SET extversion = ''ANY'' WHERE extname = %1$L;'
-						'ALTER EXTENSION %1$I UPDATE TO %2$I',
-						rec.name, target_version
+								>= pg_catalog.substring(rec.installed_version, '[0-9]+\.[0-9]+\.[0-9]+')
+			THEN
+				sql = format(
+					'UPDATE pg_catalog.pg_extension SET extversion = ''ANY'' WHERE extname = %1$L;'
+					'ALTER EXTENSION %1$I UPDATE TO %2$I',
+					rec.name, target_version
 				);
 			-- sandboxed users do standard upgrade
-			ELSIF pg_catalog.substring(target_version, '[0-9]+\.[0-9]+\.[0-9]+')
-								>= pg_catalog.substring(rec.installed_version, '[0-9]+\.[0-9]+\.[0-9]+') THEN
+			ELSE
 				sql = format(
 				'ALTER EXTENSION %1$I UPDATE TO %2$I',
 				rec.name, target_version
 				);
 			END IF;
-			IF sql > '' THEN
-				RAISE NOTICE 'Updating extension % %',
-					rec.name, rec.installed_version;
-				RAISE DEBUG '%', sql;
-				EXECUTE sql;
-			ELSE
-				RAISE NOTICE 'Downgrade % from % to % not allowed',
-						rec.name, rec.installed_version, target_version;
-			END IF;
+			RAISE NOTICE 'Updating extension % %',
+				rec.name, rec.installed_version;
+			RAISE DEBUG '%', sql;
+			EXECUTE sql;
 		END IF; --}
 
 	END LOOP; --}

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

Summary of changes:
 postgis/postgis.sql.in | 27 +++++++++++----------------
 1 file changed, 11 insertions(+), 16 deletions(-)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list