[postgis-tickets] [SCM] PostGIS branch stable-3.1 updated. 3.1.4-22-g3cd3b5e5a

git at osgeo.org git at osgeo.org
Wed Dec 22 10:29:01 PST 2021


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.1 has been updated
       via  3cd3b5e5a5c063a127f36a805a81af36a89aced9 (commit)
       via  56392d23214f33bce68f83144b8389fc09efee1b (commit)
      from  3d947448b9c939b321bc22b85c719845722ecc3d (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 3cd3b5e5a5c063a127f36a805a81af36a89aced9
Author: Sandro Santilli <strk at kbt.io>
Date:   Wed Dec 22 15:10:59 2021 +0100

    Do not rewrite rules on upgrade (too dangerous)
    
    References #5033 in stable-3.1 branch (3.1.5dev)
    Drop deprecated function after updgrade in CI

diff --git a/utils/postgis_proc_upgrade.pl b/utils/postgis_proc_upgrade.pl
index 0d804cfa9..7f135f40c 100755
--- a/utils/postgis_proc_upgrade.pl
+++ b/utils/postgis_proc_upgrade.pl
@@ -616,40 +616,40 @@ BEGIN
     WHERE proname = ANY ('${deprecated_names}'::name[])
     INTO deprecated_functions;
 
-    -- Rewrite views using deprecated functions
-    -- to improve the odds of being able to drop them
-
-    FOR rec IN
-        SELECT n.nspname AS schemaname,
-            c.relname AS viewname,
-            pg_get_userbyid(c.relowner) AS viewowner,
-            pg_get_viewdef(c.oid) AS definition,
-            CASE
-                WHEN 'check_option=cascaded' = ANY (c.reloptions) THEN 'WITH CASCADED CHECK OPTION'
-                WHEN 'check_option=local' = ANY (c.reloptions) THEN 'WITH LOCAL CHECK OPTION'
-                ELSE ''
-            END::text AS check_option
-        FROM pg_class c
-        LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
-        WHERE c.relkind = 'v'
-        AND pg_get_viewdef(c.oid) ~ 'deprecated_by_postgis'
-    LOOP
-        sql := format('CREATE OR REPLACE VIEW %I.%I AS %s %s',
-            rec.schemaname,
-            rec.viewname,
-            regexp_replace(rec.definition, '_deprecated_by_postgis_[^(]*', '', 'g'),
-            rec.check_option
-        );
-        RAISE NOTICE 'Updating view % to not use deprecated signatures', rec.viewname;
-        BEGIN
-            EXECUTE sql;
-        EXCEPTION
-        WHEN OTHERS THEN
-                GET STACKED DIAGNOSTICS detail := PG_EXCEPTION_DETAIL;
-                RAISE WARNING 'Could not rewrite view % using deprecated functions', rec.viewname
-                        USING DETAIL = format('%s: %s', SQLERRM, detail);
-        END;
-    END LOOP;
+--    -- Rewrite views using deprecated functions
+--    -- to improve the odds of being able to drop them
+--
+--    FOR rec IN
+--        SELECT n.nspname AS schemaname,
+--            c.relname AS viewname,
+--            pg_get_userbyid(c.relowner) AS viewowner,
+--            pg_get_viewdef(c.oid) AS definition,
+--            CASE
+--                WHEN 'check_option=cascaded' = ANY (c.reloptions) THEN 'WITH CASCADED CHECK OPTION'
+--                WHEN 'check_option=local' = ANY (c.reloptions) THEN 'WITH LOCAL CHECK OPTION'
+--                ELSE ''
+--            END::text AS check_option
+--        FROM pg_class c
+--        LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
+--        WHERE c.relkind = 'v'
+--        AND pg_get_viewdef(c.oid) ~ 'deprecated_by_postgis'
+--    LOOP
+--        sql := format('CREATE OR REPLACE VIEW %I.%I AS %s %s',
+--            rec.schemaname,
+--            rec.viewname,
+--            regexp_replace(rec.definition, '_deprecated_by_postgis_[^(]*', '', 'g'),
+--            rec.check_option
+--        );
+--        RAISE NOTICE 'Updating view % to not use deprecated signatures', rec.viewname;
+--        BEGIN
+--            EXECUTE sql;
+--        EXCEPTION
+--        WHEN OTHERS THEN
+--                GET STACKED DIAGNOSTICS detail := PG_EXCEPTION_DETAIL;
+--                RAISE WARNING 'Could not rewrite view % using deprecated functions', rec.viewname
+--                        USING DETAIL = format('%s: %s', SQLERRM, detail);
+--        END;
+--    END LOOP;
 
     -- Try to drop all deprecated functions, raising a warning
     -- for each one which cannot be drop

commit 56392d23214f33bce68f83144b8389fc09efee1b
Author: Sandro Santilli <strk at kbt.io>
Date:   Sun Dec 19 19:38:19 2021 +0100

    Allow upgrades from <3.1 when using ST_Force{3D,3DM,3DZ,4D} in views

diff --git a/postgis/postgis.sql.in b/postgis/postgis.sql.in
index accda4fa7..dc08f1166 100644
--- a/postgis/postgis.sql.in
+++ b/postgis/postgis.sql.in
@@ -1358,6 +1358,7 @@ CREATE OR REPLACE FUNCTION ST_Force2D(geometry)
 
 -- Availability: 2.1.0
 -- Changed: 3.1.0 - add zvalue=0.0 parameter
+-- Replaces ST_Force3DZ(geometry) deprecated in 3.1.0
 CREATE OR REPLACE FUNCTION ST_Force3DZ(geom geometry, zvalue float8 default 0.0)
 	RETURNS geometry
 	AS 'MODULE_PATHNAME', 'LWGEOM_force_3dz'
@@ -1366,6 +1367,7 @@ CREATE OR REPLACE FUNCTION ST_Force3DZ(geom geometry, zvalue float8 default 0.0)
 
 -- Availability: 2.1.0
 -- Changed: 3.1.0 - add zvalue=0.0 parameter
+-- Replaces ST_Force3D(geometry) deprecated in 3.1.0
 CREATE OR REPLACE FUNCTION ST_Force3D(geom geometry, zvalue float8 default 0.0)
 	RETURNS geometry
 	AS 'SELECT @extschema at .ST_Force3DZ($1, $2)'
@@ -1374,6 +1376,7 @@ CREATE OR REPLACE FUNCTION ST_Force3D(geom geometry, zvalue float8 default 0.0)
 
 -- Availability: 2.1.0
 -- Changed: 3.1.0 - add mvalue=0.0 parameter
+-- Replaces ST_Force3DM(geometry) deprecated in 3.1.0
 CREATE OR REPLACE FUNCTION ST_Force3DM(geom geometry, mvalue float8 default 0.0)
 	RETURNS geometry
 	AS 'MODULE_PATHNAME', 'LWGEOM_force_3dm'
@@ -1382,6 +1385,7 @@ CREATE OR REPLACE FUNCTION ST_Force3DM(geom geometry, mvalue float8 default 0.0)
 
 -- Availability: 2.1.0
 -- Changed: 3.1.0 - add zvalue=0.0 and mvalue=0.0 parameters
+-- Replaces ST_Force4D(geometry) deprecated in 3.1.0
 CREATE OR REPLACE FUNCTION ST_Force4D(geom geometry, zvalue float8 default 0.0, mvalue float8 default 0.0)
 	RETURNS geometry
 	AS 'MODULE_PATHNAME', 'LWGEOM_force_4d'
diff --git a/postgis/postgis_before_upgrade.sql b/postgis/postgis_before_upgrade.sql
index fd104bc8e..3ba6956bf 100644
--- a/postgis/postgis_before_upgrade.sql
+++ b/postgis/postgis_before_upgrade.sql
@@ -194,13 +194,6 @@ SELECT _postgis_drop_function_if_needed
     'zoom integer, x integer, y integer, bounds geometry DEFAULT ''0102000020110F00000200000052107C45F81B73C152107C45F81B73C152107C45F81B734152107C45F81B7341''::geometry'
     );
 
--- FUNCTION ST_Force3D, ST_Force3DZ, ST_Force3DM, ST_Force4DZ changed to add defaults in 3.1
--- These signatures were superseeded
-DROP FUNCTION IF EXISTS ST_Force3D(geometry); -- Does not conflict
-DROP FUNCTION IF EXISTS ST_Force3DZ(geometry); -- Does not conflict
-DROP FUNCTION IF EXISTS ST_Force3DM(geometry); -- Does not conflict
-DROP FUNCTION IF EXISTS ST_Force4D(geometry); -- Does not conflict
-
 
 -- FUNCTION st_askml changed to add defaults in 3.0 / r17357
 -- These signatures were superseeded

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

Summary of changes:
 postgis/postgis.sql.in             |  4 +++
 postgis/postgis_before_upgrade.sql |  7 ----
 utils/postgis_proc_upgrade.pl      | 68 +++++++++++++++++++-------------------
 3 files changed, 38 insertions(+), 41 deletions(-)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list