[postgis-tickets] [SCM] PostGIS branch stable-3.2 updated. 3.2.0-8-g690011b5c

git at osgeo.org git at osgeo.org
Mon Dec 27 01:52:40 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  690011b5c136329be3fe0c022eea4d882c13ed2f (commit)
      from  e65292b7b9384ae4039a2920fdde7e5a07baf70b (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 690011b5c136329be3fe0c022eea4d882c13ed2f
Author: Sandro Santilli <strk at kbt.io>
Date:   Wed Dec 22 22:12:18 2021 +0100

    Add support for upgrading in presence of views using deprecated ST_DWithin
    
    References #5035 in 3.2 branch (3.2.1dev)

diff --git a/NEWS b/NEWS
index cedae046c..75332c299 100644
--- a/NEWS
+++ b/NEWS
@@ -2,7 +2,7 @@ PostGIS 3.2.1dev
 YYYY/MM/DD
 
 * Bug Fixes *
-  - #5033, allow upgrades in presence of views using deprecated
+  - #5033, #5035, allow upgrades in presence of views using deprecated
            functions (Sandro Santilli)
 
 PostGIS 3.2.0 (Olivier Courtin Edition)
diff --git a/postgis/geography.sql.in b/postgis/geography.sql.in
index 90ca01723..5b4e904ab 100644
--- a/postgis/geography.sql.in
+++ b/postgis/geography.sql.in
@@ -809,6 +809,8 @@ CREATE OR REPLACE FUNCTION ST_Covers(geog1 geography, geog2 geography)
 	_COST_HIGH;
 
 -- Availability: 1.5.0
+-- Changed: 3.0.0 to use default and named args
+-- Replaces ST_DWithin(geography, geography, float8) deprecated in 3.0.0
 CREATE OR REPLACE FUNCTION ST_DWithin(geog1 geography, geog2 geography, tolerance float8, use_spheroid boolean DEFAULT true)
 	RETURNS boolean
 	AS 'MODULE_PATHNAME','geography_dwithin'
@@ -832,7 +834,7 @@ CREATE OR REPLACE FUNCTION ST_Intersects(geog1 geography, geog2 geography)
 	LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE
 	_COST_HIGH;
 
-#else
+#else /* POSTGIS_PGSQL_VERSION < 120 */
 
 -- Only implemented for polygon-over-point
 -- Availability: 1.5.0
@@ -849,6 +851,8 @@ CREATE OR REPLACE FUNCTION ST_CoveredBy(geog1 geography, geog2 geography)
 	LANGUAGE 'sql' IMMUTABLE PARALLEL SAFE;
 
 -- Availability: 1.5.0
+-- Changed: 3.0.0 to use default and named args
+-- Replaces ST_DWithin(geography, geography, float8) deprecated in 3.0.0
 CREATE OR REPLACE FUNCTION ST_DWithin(geog1 geography, geog2 geography, tolerance float8, use_spheroid boolean DEFAULT true)
 	RETURNS boolean
 	AS 'SELECT $1 OPERATOR(@extschema at .&&) @extschema at ._ST_Expand($2,$3) AND $2 OPERATOR(@extschema at .&&) @extschema at ._ST_Expand($1,$3) AND @extschema at ._ST_DWithin($1, $2, $3, $4)'
@@ -859,7 +863,7 @@ CREATE OR REPLACE FUNCTION ST_Intersects(geography, geography)
 	AS 'SELECT $1 OPERATOR(@extschema at .&&) $2 AND @extschema at .ST_Distance($1, $2, false) < 0.00001'
 	LANGUAGE 'sql' IMMUTABLE PARALLEL SAFE;
 
-#endif
+#endif /* POSTGIS_PGSQL_VERSION < 120 */
 
 -- Availability: 1.5.0 - this is just a hack to prevent unknown from causing ambiguous name because of geography
 CREATE OR REPLACE FUNCTION ST_Covers(text, text)
diff --git a/postgis/postgis.sql.in b/postgis/postgis.sql.in
index 5c8ef4c2b..b901614a2 100644
--- a/postgis/postgis.sql.in
+++ b/postgis/postgis.sql.in
@@ -4339,6 +4339,7 @@ CREATE OR REPLACE FUNCTION ST_LineCrossingDirection(line1 geometry, line2 geomet
 	_COST_HIGH;
 
 -- Availability: 1.3.4
+-- Replaces ST_DWithin(text, text, float8) deprecated in 3.0.0
 CREATE OR REPLACE FUNCTION ST_DWithin(geom1 geometry, geom2 geometry,float8)
 	RETURNS boolean
 	AS 'MODULE_PATHNAME', 'LWGEOM_dwithin'
diff --git a/postgis/postgis_after_upgrade.sql b/postgis/postgis_after_upgrade.sql
index bab8d358e..44772dd0e 100644
--- a/postgis/postgis_after_upgrade.sql
+++ b/postgis/postgis_after_upgrade.sql
@@ -116,7 +116,6 @@ DROP FUNCTION IF EXISTS st_box3d(geometry);
 DROP FUNCTION IF EXISTS st_box(geometry);
 DROP FUNCTION IF EXISTS _st_buffer(geometry, float8, cstring); -- dropped in PostGIS-3.0 (r17300)
 DROP FUNCTION IF EXISTS ST_ConcaveHull(geometry,float); -- this one changed to use default parameters
-DROP FUNCTION IF EXISTS ST_DWithin(geography, geography, float8); -- this one changed to use default parameters
 DROP FUNCTION IF EXISTS st_text(geometry);
 DROP FUNCTION IF EXISTS st_geometry(box2d);
 DROP FUNCTION IF EXISTS st_geometry(box3d);
diff --git a/regress/hooks/hook-after-upgrade.sql b/regress/hooks/hook-after-upgrade.sql
index 4343f448a..0ca56e675 100644
--- a/regress/hooks/hook-after-upgrade.sql
+++ b/regress/hooks/hook-after-upgrade.sql
@@ -4,6 +4,7 @@ DROP VIEW IF EXISTS upgrade_view_test_subdivide;
 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 VIEW IF EXISTS upgrade_view_test_dwithin;
 DROP TABLE upgrade_test;
 
 -- Drop functions deprecated on upgrade
@@ -18,3 +19,5 @@ 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);
+DROP FUNCTION IF EXISTS st_dwithin_deprecated_by_postgis_300(geography,geography,float8);
+DROP FUNCTION IF EXISTS st_dwithin_deprecated_by_postgis_300(text,text,float8);
diff --git a/regress/hooks/hook-before-upgrade.sql b/regress/hooks/hook-before-upgrade.sql
index e5e541888..2aed016f7 100644
--- a/regress/hooks/hook-before-upgrade.sql
+++ b/regress/hooks/hook-before-upgrade.sql
@@ -66,3 +66,11 @@ SELECT
 	ST_AsKML(g1) as geometry_askml,
 	ST_AsKML(g2) as geography_askml
 FROM upgrade_test;
+
+-- Add view using ST_DWithin function
+-- NOTE: 2.0.0 changed them to add default params
+CREATE VIEW upgrade_view_test_dwithin AS
+SELECT
+	ST_DWithin(g1::text, g1::text, 1) as text_dwithin,
+	ST_DWithin(g2, g2, 1) as geography_dwithin
+FROM upgrade_test;

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

Summary of changes:
 NEWS                                  | 2 +-
 postgis/geography.sql.in              | 8 ++++++--
 postgis/postgis.sql.in                | 1 +
 postgis/postgis_after_upgrade.sql     | 1 -
 regress/hooks/hook-after-upgrade.sql  | 3 +++
 regress/hooks/hook-before-upgrade.sql | 8 ++++++++
 6 files changed, 19 insertions(+), 4 deletions(-)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list