[postgis-tickets] [SCM] PostGIS branch stable-3.1 updated. 3.1.8-15-g61d961d22
git at osgeo.org
git at osgeo.org
Fri May 12 08:35:51 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 61d961d226fb50beda1620ddcdc55b724b55a9d2 (commit)
via eed5b62343d9509c4c96e6e49ab694d289dc8127 (commit)
via 4d21237a5c340653658d3c0665a795f30b0e60ec (commit)
via 476f19b458dca25b537e2a6209f7f3b8885785e5 (commit)
from 16913466438043b5e74570b0e497dd4d72343851 (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 61d961d226fb50beda1620ddcdc55b724b55a9d2
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
Closes #5380 in 3.1 branch (3.1.9dev)
diff --git a/NEWS b/NEWS
index d1cb3c3ca..c4b1300c7 100644
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,8 @@ PostGIS 3.1.9dev
xxxx/xx/xx
* Bug Fixes
+ - #5380, Fix 2.5 upgrades with views using geography based ST_Distance
+ (Sandro Santilli)
- #5338, Dump/Restore of raster table fails on
enforce_coverage_tile_rast constraint (Regina Obe)
- #5315, #5318, #5319, #5320, #5342 crashes on infinite coordinates
diff --git a/postgis/geography.sql.in b/postgis/geography.sql.in
index e28ba77bc..12e4035a6 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 a2c280216..3c68a0d2c 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 fb89ce25d..efc4e72c5 100644
--- a/regress/hooks/hook-after-upgrade.sql
+++ b/regress/hooks/hook-after-upgrade.sql
@@ -7,6 +7,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 913e2728f..279ca368c 100644
--- a/regress/hooks/hook-before-upgrade.sql
+++ b/regress/hooks/hook-before-upgrade.sql
@@ -81,3 +81,12 @@ CREATE VIEW upgrade_view_test_clusterkmeans AS
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;
commit eed5b62343d9509c4c96e6e49ab694d289dc8127
Author: Sandro Santilli <strk at kbt.io>
Date: Fri May 12 17:27:58 2023 +0200
Test upgrades with views using ST_DWithin and ST_ClusterKMeans
diff --git a/regress/hooks/hook-after-upgrade.sql b/regress/hooks/hook-after-upgrade.sql
index 1b2706c62..fb89ce25d 100644
--- a/regress/hooks/hook-after-upgrade.sql
+++ b/regress/hooks/hook-after-upgrade.sql
@@ -5,6 +5,8 @@ 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 VIEW IF EXISTS upgrade_view_test_clusterkmeans;
DROP TABLE upgrade_test;
-- Drop functions deprecated on upgrade
@@ -17,3 +19,6 @@ DROP FUNCTION IF EXISTS st_difference_deprecated_by_postgis_301(geometry,geometr
DROP FUNCTION IF EXISTS st_symdifference_deprecated_by_postgis_301(geometry,geometry);
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_dwithin_deprecated_by_postgis_300(geography,geography,float8);
+DROP FUNCTION IF EXISTS st_dwithin_deprecated_by_postgis_300(text,text,float8);
+DROP FUNCTION IF EXISTS st_clusterkmeans_deprecated_by_postgis_302(geometry,integer);
diff --git a/regress/hooks/hook-before-upgrade.sql b/regress/hooks/hook-before-upgrade.sql
index 274123988..913e2728f 100644
--- a/regress/hooks/hook-before-upgrade.sql
+++ b/regress/hooks/hook-before-upgrade.sql
@@ -66,3 +66,18 @@ SELECT
ST_AsKML(g1) as geometry_askml,
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
+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;
+
+-- Add view using ST_ClusterKMeans windowing function
+-- NOTE: 3.2.0 changed it to add max_radius parameter
+CREATE VIEW upgrade_view_test_clusterkmeans AS
+SELECT
+ ST_ClusterKMeans(g1, 1) OVER ()
+FROM upgrade_test;
commit 4d21237a5c340653658d3c0665a795f30b0e60ec
Author: Sandro Santilli <strk at kbt.io>
Date: Sun Dec 19 22:48:45 2021 +0100
Replace ST_AsKML deprecated signatures drop with Replaces comments
Includes regression test
diff --git a/postgis/geography.sql.in b/postgis/geography.sql.in
index fa6bd1f92..e28ba77bc 100644
--- a/postgis/geography.sql.in
+++ b/postgis/geography.sql.in
@@ -452,6 +452,7 @@ CREATE OR REPLACE FUNCTION ST_AsGML(text)
-- AsKML(geography,precision)
-- Changed: 2.0.0 to use default args and named args
+-- Replaces ST_AsKML(geography, int4) deprecated in 2.0.0
CREATE OR REPLACE FUNCTION ST_AsKML(geog geography, maxdecimaldigits integer DEFAULT 15, nprefix text DEFAULT '')
RETURNS text
AS 'MODULE_PATHNAME','geography_as_kml'
diff --git a/postgis/postgis.sql.in b/postgis/postgis.sql.in
index ea8e27ce5..0f7362c28 100644
--- a/postgis/postgis.sql.in
+++ b/postgis/postgis.sql.in
@@ -4764,6 +4764,7 @@ CREATE OR REPLACE FUNCTION ST_AsGML(version integer, geom geometry, maxdecimaldi
-- Availability: 1.2.2
-- Changed: 2.0.0 to use default args and allow named args
+-- Replaces ST_AsKML(geometry, int4) deprecated in 2.0.0
CREATE OR REPLACE FUNCTION ST_AsKML(geom geometry, maxdecimaldigits integer DEFAULT 15, nprefix TEXT default '')
RETURNS TEXT
AS 'MODULE_PATHNAME','LWGEOM_asKML'
diff --git a/postgis/postgis_after_upgrade.sql b/postgis/postgis_after_upgrade.sql
index 6807d6e88..a2c280216 100644
--- a/postgis/postgis_after_upgrade.sql
+++ b/postgis/postgis_after_upgrade.sql
@@ -196,7 +196,6 @@ 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);
DROP FUNCTION IF EXISTS ST_AsKML(int4, geometry, int4, text);
-DROP FUNCTION IF EXISTS ST_AsKML(geometry, int4);
DROP FUNCTION IF EXISTS ST_AsGeoJson(int4, geometry, int4, int4);
DROP FUNCTION IF EXISTS _ST_AsGeoJson(int4, geometry, int4, int4);
diff --git a/postgis/postgis_before_upgrade.sql b/postgis/postgis_before_upgrade.sql
index 5192032b4..00f23a5f3 100644
--- a/postgis/postgis_before_upgrade.sql
+++ b/postgis/postgis_before_upgrade.sql
@@ -191,12 +191,6 @@ SELECT _postgis_drop_function_if_needed
);
--- FUNCTION st_askml changed to add defaults in 3.0 / r17357
--- These signatures were superseeded
-DROP FUNCTION IF EXISTS st_askml(geometry, integer); -- Does not conflict
-DROP FUNCTION IF EXISTS st_askml(geography, integer); -- Does not conflict
-
-
-- FUNCTION st_buffer changed to add defaults in 3.0
-- This signature was superseeded
DROP FUNCTION IF EXISTS st_buffer(geometry, double precision); -- Does not conflict
diff --git a/regress/hooks/hook-after-upgrade.sql b/regress/hooks/hook-after-upgrade.sql
index 459f80249..1b2706c62 100644
--- a/regress/hooks/hook-after-upgrade.sql
+++ b/regress/hooks/hook-after-upgrade.sql
@@ -1,2 +1,19 @@
DROP VIEW IF EXISTS upgrade_view_test;
+DROP VIEW IF EXISTS upgrade_view_test_overlay;
+DROP VIEW IF EXISTS upgrade_view_test_unaryunion;
+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 TABLE upgrade_test;
+
+-- Drop functions deprecated on upgrade
+DROP FUNCTION IF EXISTS st_force3dz_deprecated_by_postgis_301(geometry);
+DROP FUNCTION IF EXISTS st_force3d_deprecated_by_postgis_301(geometry);
+DROP FUNCTION IF EXISTS st_force3dm_deprecated_by_postgis_301(geometry);
+DROP FUNCTION IF EXISTS st_force4d_deprecated_by_postgis_301(geometry);
+DROP FUNCTION IF EXISTS st_intersection_deprecated_by_postgis_301(geometry,geometry);
+DROP FUNCTION IF EXISTS st_difference_deprecated_by_postgis_301(geometry,geometry);
+DROP FUNCTION IF EXISTS st_symdifference_deprecated_by_postgis_301(geometry,geometry);
+DROP FUNCTION IF EXISTS st_unaryunion_deprecated_by_postgis_301(geometry);
+DROP FUNCTION IF EXISTS st_subdivide_deprecated_by_postgis_301(geometry,integer);
diff --git a/regress/hooks/hook-before-upgrade.sql b/regress/hooks/hook-before-upgrade.sql
index d4bcb8cd6..274123988 100644
--- a/regress/hooks/hook-before-upgrade.sql
+++ b/regress/hooks/hook-before-upgrade.sql
@@ -24,3 +24,45 @@ BEGIN
END IF;
END;
$BODY$ LANGUAGE 'plpgsql';
+
+-- Add view using overlay functions
+CREATE VIEW upgrade_view_test_overlay AS
+SELECT
+ ST_Intersection(g1, g1) as geometry_intersection,
+ ST_Intersection(g2, g2) as geography_intersection,
+ ST_Difference(g1, g1) as geometry_difference,
+ ST_SymDifference(g1, g1) as geometry_symdifference
+FROM upgrade_test;
+
+-- Add view using unaryunion function
+-- NOTE: 2.0.0 introduced ST_UnaryUnion
+CREATE VIEW upgrade_view_test_unaryunion AS
+SELECT
+ ST_UnaryUnion(g1) as geometry_unaryunion
+FROM upgrade_test;
+
+-- Add view using unaryunion function
+-- NOTE: 2.2.0 introduced ST_Subdivide
+CREATE VIEW upgrade_view_test_subdivide AS
+SELECT
+ ST_Subdivide(g1, 256) as geometry_subdivide
+FROM upgrade_test;
+
+-- Add view using ST_ForceX function
+-- NOTE: 3.1.0 changed them from taking only geometry
+-- to also take optional zvalue/mvalue params
+CREATE VIEW upgrade_view_test_force_dims AS
+SELECT
+ ST_Force3D(g1) as geometry_force3d,
+ ST_Force3DZ(g1) as geometry_force3dz,
+ ST_Force3DM(g1) as geometry_force3dm,
+ ST_Force4D(g1) as geometry_force4d
+FROM upgrade_test;
+
+-- Add view using ST_AsKML function
+-- NOTE: 2.0.0 changed them to add default params
+CREATE VIEW upgrade_view_test_askml AS
+SELECT
+ ST_AsKML(g1) as geometry_askml,
+ ST_AsKML(g2) as geography_askml
+FROM upgrade_test;
commit 476f19b458dca25b537e2a6209f7f3b8885785e5
Author: Sandro Santilli <strk at kbt.io>
Date: Fri May 12 15:19:46 2023 +0200
Encode dependency of postgis.sql on its effective sources
diff --git a/postgis/Makefile.in b/postgis/Makefile.in
index 59eb918ad..c34803379 100644
--- a/postgis/Makefile.in
+++ b/postgis/Makefile.in
@@ -240,7 +240,7 @@ postgis_upgrade.sql: postgis_before_upgrade.sql postgis_upgrade.sql.in postgis_a
# SQL objects are also dependent on postgis_config.h for PostgreSQL version
$(SQL_OBJS): ../postgis_config.h ../postgis_revision.h
-#postgis.sql.in: sqldefines.h long_xact.sql.in.c geography.sql.in.c
+postgis.sql: sqldefines.h long_xact.sql.in geography.sql.in postgis_brin.sql.in postgis_spgist.sql.in
uninstall_postgis.sql: postgis.sql ../utils/create_undef.pl
$(PERL) ../utils/create_undef.pl $< $(POSTGIS_PGSQL_VERSION) > $@
-----------------------------------------------------------------------
Summary of changes:
NEWS | 2 ++
postgis/Makefile.in | 2 +-
postgis/geography.sql.in | 2 ++
postgis/postgis.sql.in | 1 +
postgis/postgis_after_upgrade.sql | 3 +-
postgis/postgis_before_upgrade.sql | 6 ----
regress/hooks/hook-after-upgrade.sql | 23 ++++++++++++
regress/hooks/hook-before-upgrade.sql | 66 +++++++++++++++++++++++++++++++++++
8 files changed, 96 insertions(+), 9 deletions(-)
hooks/post-receive
--
PostGIS
More information about the postgis-tickets
mailing list