[postgis-tickets] [SCM] PostGIS branch stable-3.3 updated. 3.3.2-56-gfaa957cf3

git at osgeo.org git at osgeo.org
Fri May 12 07:32:41 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.3 has been updated
       via  faa957cf3926e1f890e6b3d892bfe27bf5493ff9 (commit)
      from  3e663a81637a352153def4fe72f7628641c1d526 (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 faa957cf3926e1f890e6b3d892bfe27bf5493ff9
Author: Sandro Santilli <strk at kbt.io>
Date:   Fri May 12 12:28:18 2023 +0200

    Fix 2.5 upgrades with views using geography based ST_Distance
    
    Include tests
    References #5380 in 3.3 branch (3.3.3dev)

diff --git a/NEWS b/NEWS
index 46ab40575..74b77e509 100644
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,8 @@ PostGIS 3.3.3dev
 YYYY/MM/DD
 
 * Bug Fixes *
+  - #5380, Fix 2.5 upgrades with views using geography based ST_Distance
+           (Sandro Santilli)
   - #5303, Don't try removing closed edges endpoint from
            RemoveUnusedPrimitives (Sandro Santilli)
   - #5289, Fix misleading message in RemoveUnusedPrimitives about
diff --git a/postgis/geography.sql.in b/postgis/geography.sql.in
index c0ccb9ccc..0ea08ce49 100644
--- a/postgis/geography.sql.in
+++ b/postgis/geography.sql.in
@@ -491,6 +491,7 @@ CREATE OR REPLACE FUNCTION ST_AsGeoJson(text)
 -- Availability: 1.5.0
 -- ---------- ---------- ---------- ---------- ---------- ---------- ----------
 
+-- Replaces ST_Distance(geography, geography) deprecated in 3.0.0
 CREATE OR REPLACE FUNCTION ST_Distance(geog1 geography, geog2 geography, use_spheroid boolean DEFAULT true)
 	RETURNS float8
 	AS 'MODULE_PATHNAME','geography_distance'
diff --git a/postgis/postgis_after_upgrade.sql b/postgis/postgis_after_upgrade.sql
index ae5408c28..41be6fd3c 100644
--- a/postgis/postgis_after_upgrade.sql
+++ b/postgis/postgis_after_upgrade.sql
@@ -191,7 +191,7 @@ DROP FUNCTION IF EXISTS _ST_DistanceRectTree(g1 geometry, g2 geometry);
 DROP FUNCTION IF EXISTS _ST_DistanceRectTreeCached(g1 geometry, g2 geometry);
 
 -- Deplicative signatures removed
-DROP FUNCTION IF EXISTS ST_Distance(geography, geography);
+DROP FUNCTION IF EXISTS ST_Distance(geography, geography); -- dropped in PostGIS-3.0 (r17300 aka ce70e4906)
 DROP FUNCTION IF EXISTS ST_Distance(geography, geography, float8, boolean);
 DROP FUNCTION IF EXISTS ST_Buffer(geometry, float8, cstring);
 DROP FUNCTION IF EXISTS ST_IsValidDetail(geometry);
diff --git a/regress/hooks/hook-after-upgrade.sql b/regress/hooks/hook-after-upgrade.sql
index 7f95eb762..b639ff77c 100644
--- a/regress/hooks/hook-after-upgrade.sql
+++ b/regress/hooks/hook-after-upgrade.sql
@@ -6,6 +6,7 @@ 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 VIEW IF EXISTS upgrade_view_test_clusterkmeans;
+DROP VIEW IF EXISTS upgrade_view_test_distance;
 DROP TABLE upgrade_test;
 
 -- Drop functions deprecated on upgrade
diff --git a/regress/hooks/hook-before-upgrade.sql b/regress/hooks/hook-before-upgrade.sql
index f15b71111..f590f9401 100644
--- a/regress/hooks/hook-before-upgrade.sql
+++ b/regress/hooks/hook-before-upgrade.sql
@@ -82,6 +82,15 @@ SELECT
 	ST_ClusterKMeans(g1, 1) OVER ()
 FROM upgrade_test;
 
+-- This view uses ST_Distance signatures, available since 1.5.0
+-- NOTE: 3.0.0 changed them to use default arguments
+-- See https://trac.osgeo.org/postgis/ticket/5380
+CREATE VIEW upgrade_view_test_distance AS
+SELECT
+	ST_Distance(g2, g2) geog_dist1,
+	ST_Distance(g2, g2, true) geog_dist2
+FROM upgrade_test;
+
 -- Break probin of all postgis functions, as we expect
 -- the upgrade procedure to replace them all
 UPDATE pg_proc SET probin = probin || '-uninstalled'

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

Summary of changes:
 NEWS                                  | 2 ++
 postgis/geography.sql.in              | 1 +
 postgis/postgis_after_upgrade.sql     | 2 +-
 regress/hooks/hook-after-upgrade.sql  | 1 +
 regress/hooks/hook-before-upgrade.sql | 9 +++++++++
 5 files changed, 14 insertions(+), 1 deletion(-)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list