[postgis-tickets] [SCM] PostGIS branch master updated. 3.2.0-14-gec98bd63e

git at osgeo.org git at osgeo.org
Mon Dec 27 01:50:19 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, master has been updated
       via  ec98bd63e8f255cbdbf6baaed850e6c8b8d57af1 (commit)
      from  5f0640152cecc35712c7818011a8f4e0c59feab7 (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 ec98bd63e8f255cbdbf6baaed850e6c8b8d57af1
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 master branch (3.3.0dev)

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:
 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 ++++++++
 5 files changed, 18 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list