[postgis-tickets] [SCM] PostGIS branch master updated. 3.3.0rc2-807-g08ede3e3f
git at osgeo.org
git at osgeo.org
Fri May 12 07:43:09 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, master has been updated
via 08ede3e3f105c4e0116125d47a4d34c83487a5ff (commit)
from 2f8729fdc5924292c476f6418b328cae98168ce1 (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 08ede3e3f105c4e0116125d47a4d34c83487a5ff
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 master branch
diff --git a/postgis/geography.sql.in b/postgis/geography.sql.in
index 948d7d4e5..6da02e208 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 c156548a9..49d0c8139 100644
--- a/regress/hooks/hook-before-upgrade.sql
+++ b/regress/hooks/hook-before-upgrade.sql
@@ -65,6 +65,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:
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 +++++++++
4 files changed, 12 insertions(+), 1 deletion(-)
hooks/post-receive
--
PostGIS
More information about the postgis-tickets
mailing list