[postgis-tickets] [SCM] PostGIS branch stable-3.2 updated. 3.2.0-4-g7020472ed

git at osgeo.org git at osgeo.org
Wed Dec 22 10:24:24 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.2 has been updated
       via  7020472ed0a763fa22ac2309a151f92b79d9a436 (commit)
      from  82d84900fdd26678767fee72677664f3f76b3db6 (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 7020472ed0a763fa22ac2309a151f92b79d9a436
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 master/main branch (3.3.0dev)
    Drop deprecated function after updgrade in CI

diff --git a/regress/hooks/hook-after-upgrade.sql b/regress/hooks/hook-after-upgrade.sql
index d7fb108a7..775e0239d 100644
--- a/regress/hooks/hook-after-upgrade.sql
+++ b/regress/hooks/hook-after-upgrade.sql
@@ -3,3 +3,16 @@ DROP VIEW IF EXISTS upgrade_view_test_unaryunion;
 DROP VIEW IF EXISTS upgrade_view_test_subdivide;
 DROP VIEW IF EXISTS upgrade_view_test_union;
 DROP TABLE upgrade_test;
+
+-- Drop functions deprecated on upgrade
+DROP FUNCTION IF EXISTS st_force3dz_deprecated_by_postgis_301(geometry);
+DROP FUNCTION IF EXISTS st_force3d_deprecated_by_postgis_301(geometry);
+DROP FUNCTION IF EXISTS st_force3dm_deprecated_by_postgis_301(geometry);
+DROP FUNCTION IF EXISTS st_force4d_deprecated_by_postgis_301(geometry);
+DROP FUNCTION IF EXISTS st_intersection_deprecated_by_postgis_301(geometry,geometry);
+DROP FUNCTION IF EXISTS st_difference_deprecated_by_postgis_301(geometry,geometry);
+DROP FUNCTION IF EXISTS st_symdifference_deprecated_by_postgis_301(geometry,geometry);
+DROP FUNCTION IF EXISTS st_unaryunion_deprecated_by_postgis_301(geometry);
+DROP FUNCTION IF EXISTS st_subdivide_deprecated_by_postgis_301(geometry,integer);
+DROP FUNCTION IF EXISTS st_askml_deprecated_by_postgis_200(geometry,integer);
+DROP FUNCTION IF EXISTS st_askml_deprecated_by_postgis_200(geography,integer);
diff --git a/utils/postgis_proc_upgrade.pl b/utils/postgis_proc_upgrade.pl
index 54071f2d3..5071c0f0e 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

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

Summary of changes:
 regress/hooks/hook-after-upgrade.sql | 13 +++++++
 utils/postgis_proc_upgrade.pl        | 68 ++++++++++++++++++------------------
 2 files changed, 47 insertions(+), 34 deletions(-)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list