[postgis-tickets] [SCM] PostGIS branch main updated. 3.2.0-9-g43f92d9a8

git at osgeo.org git at osgeo.org
Wed Dec 22 10:23:59 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, main has been updated
       via  43f92d9a8f90eb3541a5d22296a74d136ab59fd4 (commit)
      from  c9dfab57937b0e9454dbded9f4f7eaebbd79d0bd (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 43f92d9a8f90eb3541a5d22296a74d136ab59fd4
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 3caffb063..4343f448a 100644
--- a/regress/hooks/hook-after-upgrade.sql
+++ b/regress/hooks/hook-after-upgrade.sql
@@ -5,3 +5,16 @@ DROP VIEW IF EXISTS upgrade_view_test_union;
 DROP VIEW IF EXISTS upgrade_view_test_force_dims;
 DROP VIEW IF EXISTS upgrade_view_test_askml;
 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