[postgis-tickets] [SCM] PostGIS branch stable-3.1 updated. 3.1.9-11-gbb104ff97

git at osgeo.org git at osgeo.org
Wed Aug 30 02:38:44 PDT 2023


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  bb104ff9738981f597f3b7775033e8d8f7e6c4af (commit)
      from  f89d37c7b344aea6458c0ee89b9814575172d56a (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 bb104ff9738981f597f3b7775033e8d8f7e6c4af
Author: Sandro Santilli <strk at kbt.io>
Date:   Tue Aug 29 17:45:50 2023 +0200

    Stop deprecating ST_DWithin(text) while not being deprecated
    
    Fixes availability/changed info for ST_DWithin(..geometry..)
    Add test for upgrades in presence of view using ST_DWithin(..geometry..)
    
    Closes #5494 in 3.1 branch (3.1.10dev)

diff --git a/NEWS b/NEWS
index c393dabfb..2f20fd86b 100644
--- a/NEWS
+++ b/NEWS
@@ -1,7 +1,9 @@
-PostGIS 3.1.10
+PostGIS 3.1.10dev
 xxxx/xx/xx
 
 * Bug Fixes *
+  - #5494, Fix double-upgrade with view using st_dwithin(text, ...)
+           (Sandro Santilli)
   - #5450, Fix macro expansion recursion on powerpc architectures
            (Bas Couwenberg)
   - #5385, Postgres malloc assertion fail when using pg_cancel_backend
diff --git a/postgis/postgis.sql.in b/postgis/postgis.sql.in
index 0f7362c28..4881337cc 100644
--- a/postgis/postgis.sql.in
+++ b/postgis/postgis.sql.in
@@ -4312,9 +4312,10 @@ CREATE OR REPLACE FUNCTION ST_LineCrossingDirection(line1 geometry, line2 geomet
 	LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE
 	_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)
+-- Availability: 1.3.0
+-- Changed: 2.0.0 added parameter names
+-- TODO: encode deprecation of the version with no parameter names ?
+CREATE OR REPLACE FUNCTION ST_DWithin(geom1 geometry, geom2 geometry, float8)
 	RETURNS boolean
 	AS 'MODULE_PATHNAME', 'LWGEOM_dwithin'
 	SUPPORT postgis_index_supportfn
diff --git a/regress/hooks/hook-before-upgrade.sql b/regress/hooks/hook-before-upgrade.sql
index 279ca368c..a41617cfa 100644
--- a/regress/hooks/hook-before-upgrade.sql
+++ b/regress/hooks/hook-before-upgrade.sql
@@ -67,13 +67,16 @@ SELECT
 	ST_AsKML(g2) as geography_askml
 FROM upgrade_test;
 
--- Add view using ST_DWithin function
--- NOTE: 3.0.0 changed them to add default params
+-- Add view using ST_DWithin functions
+-- See https://trac.osgeo.org/postgis/ticket/5494
 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;
+	ST_DWithin(NULL::text, NULL::text, NULL::float8) as text_dwithin,
+	-- Available since 1.5.0, changed in 3.0.0 to add optional 4th use_spheroid param
+	ST_DWithin(NULL::geography, NULL::geography, NULL::float8) as geography_dwithin,
+	-- Available since 1.3.0
+	ST_DWithin(NULL::geometry, NULL::geometry, NULL::float8) as geometry_dwithin
+;
 
 -- Add view using ST_ClusterKMeans windowing function
 -- NOTE: 3.2.0 changed it to add max_radius parameter

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

Summary of changes:
 NEWS                                  |  4 +++-
 postgis/postgis.sql.in                |  7 ++++---
 regress/hooks/hook-before-upgrade.sql | 13 ++++++++-----
 3 files changed, 15 insertions(+), 9 deletions(-)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list