[postgis-tickets] [SCM] PostGIS branch stable-3.4 updated. 3.4.0-5-gd2687d2d8
git at osgeo.org
git at osgeo.org
Mon Aug 28 13:06:02 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.4 has been updated
via d2687d2d8138983cebaa2deafa5ebf428174d5f0 (commit)
from fe22c117751e1de0968ed444ac10df5028f82ecc (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 d2687d2d8138983cebaa2deafa5ebf428174d5f0
Author: Sandro Santilli <strk at kbt.io>
Date: Mon Aug 28 19:10:20 2023 +0200
Fix upgrades in presence of views using ST_Clip
Includes regress test
References #5488 in 3.4 branch (3.4.1dev)
diff --git a/NEWS b/NEWS
index 2d9d4e459..9d4395938 100644
--- a/NEWS
+++ b/NEWS
@@ -6,6 +6,7 @@ To take advantage of all SFCGAL featurs, SFCGAL 1.4.1+ is needed.
* Bug Fixes *
+ - #5488, Fix upgrade with view using st_clip(raster, ...)
- #5484, Fix upgrade with view using st_value(raster,geometry,bool)
- #5479, postgis_full_version() and postgis_gdal_version() sometimes
warn of deprecated SRID: 2163 (Regina Obe)
diff --git a/raster/rt_pg/rtpostgis.sql.in b/raster/rt_pg/rtpostgis.sql.in
index dad551aa3..5424398fb 100644
--- a/raster/rt_pg/rtpostgis.sql.in
+++ b/raster/rt_pg/rtpostgis.sql.in
@@ -6555,11 +6555,14 @@ CREATE OR REPLACE FUNCTION _st_clip(
LANGUAGE 'c' IMMUTABLE PARALLEL SAFE;
-- Availability: 2.0.0
--- Changed: 2.1.0
+-- Changed: 2.1.0 - renamed the band parameter
+-- Replaces st_clip(rast raster, band int, geom geometry, nodataval float8, crop boolean) deprecated in 2.1.0
CREATE OR REPLACE FUNCTION st_clip(
- rast raster, nband integer[],
+ rast raster,
+ nband integer[],
geom geometry,
- nodataval double precision[] DEFAULT NULL, crop boolean DEFAULT TRUE
+ nodataval double precision[] DEFAULT NULL,
+ crop boolean DEFAULT TRUE
)
RETURNS raster
AS $$
@@ -6584,8 +6587,11 @@ CREATE OR REPLACE FUNCTION st_clip(
LANGUAGE 'sql' IMMUTABLE PARALLEL SAFE;
-- Availability: 2.0.0
+-- Changed: 2.1.0 -- renamed the band parameter
+-- Replaces st_clip(rast raster, band int, geom geometry, crop boolean) deprecated in 2.1.0
CREATE OR REPLACE FUNCTION st_clip(
- rast raster, nband integer,
+ rast raster,
+ nband integer,
geom geometry,
crop boolean
)
diff --git a/raster/rt_pg/rtpostgis_drop.sql.in b/raster/rt_pg/rtpostgis_drop.sql.in
index cde5bdddf..5f4a8f9aa 100644
--- a/raster/rt_pg/rtpostgis_drop.sql.in
+++ b/raster/rt_pg/rtpostgis_drop.sql.in
@@ -69,6 +69,8 @@ DROP FUNCTION IF EXISTS _st_mapalgebra4unionstate(raster, raster, text);
DROP FUNCTION IF EXISTS _st_mapalgebra4unionstate(raster, raster, int4, text);
-- Removed in 2.1.0
DROP FUNCTION IF EXISTS _st_mapalgebra4unionstate(raster, raster, text, text, text, float8, text, text, text, float8);
+-- Removed in 2.1.0
+DROP FUNCTION IF EXISTS st_clip(raster, int, geometry, float8[], boolean);
-- Removed in 2.2.0
DROP FUNCTION IF EXISTS _st_mapalgebra(rastbandarg[],regprocedure,text,integer,integer,text,raster,text[]);
diff --git a/raster/rt_pg/rtpostgis_upgrade_cleanup.sql.in b/raster/rt_pg/rtpostgis_upgrade_cleanup.sql.in
index 95f2e2e6c..bed083b66 100644
--- a/raster/rt_pg/rtpostgis_upgrade_cleanup.sql.in
+++ b/raster/rt_pg/rtpostgis_upgrade_cleanup.sql.in
@@ -452,12 +452,9 @@ DROP FUNCTION IF EXISTS st_intersection(raster, int, geometry, text, regprocedur
DROP FUNCTION IF EXISTS st_intersection(raster, int, geometry, regprocedure);
DROP FUNCTION IF EXISTS st_intersection(raster, geometry, text, regprocedure);
DROP FUNCTION IF EXISTS st_intersection(raster, geometry, regprocedure);
-DROP FUNCTION IF EXISTS st_clip(raster, integer, geometry, boolean);
-DROP FUNCTION IF EXISTS st_clip(raster, geometry, float8, boolean);
-DROP FUNCTION IF EXISTS st_clip(raster, geometry, boolean);
-DROP FUNCTION IF EXISTS st_clip(raster, int, geometry, float8, boolean);
-DROP FUNCTION IF EXISTS st_clip(raster, geometry, float8[], boolean);
-DROP FUNCTION IF EXISTS st_clip(raster, integer, geometry, float8[], boolean);
+--DROP FUNCTION IF EXISTS st_clip(raster, geometry, float8, boolean); --------- sig5, not changed since 2.0.0, maybe changed before ?
+--DROP FUNCTION IF EXISTS st_clip(raster, geometry, boolean); ----------------- sig6, not changed since 2.0.0, maybe changed before ?
+--DROP FUNCTION IF EXISTS st_clip(raster, geometry, float8[], boolean); ------- sig4, not changed since 2.0.0, maybe changed before ?
-- refactoring of functions
DROP FUNCTION IF EXISTS _st_dumpaswktpolygons(raster, integer);
diff --git a/raster/test/regress/hooks/hook-after-upgrade-raster.sql b/raster/test/regress/hooks/hook-after-upgrade-raster.sql
index fffb6f7f0..b044120f7 100644
--- a/raster/test/regress/hooks/hook-after-upgrade-raster.sql
+++ b/raster/test/regress/hooks/hook-after-upgrade-raster.sql
@@ -1,6 +1,10 @@
DROP VIEW upgrade_test_raster_view_st_value;
+DROP VIEW upgrade_test_raster_view_st_clip;
+
DROP TABLE upgrade_test_raster;
DROP TABLE upgrade_test_raster_with_regular_blocking;
-- Drop functions deprecated on upgrade
DROP FUNCTION IF EXISTS st_value_deprecated_by_postgis_201(raster,geometry,boolean);
+
+--DROP FUNCTION IF EXISTS st_value_deprecated_by_postgis_201(raster,geometry,boolean);
diff --git a/raster/test/regress/hooks/hook-before-upgrade-raster.sql b/raster/test/regress/hooks/hook-before-upgrade-raster.sql
index c2e42c97f..c445200c8 100644
--- a/raster/test/regress/hooks/hook-before-upgrade-raster.sql
+++ b/raster/test/regress/hooks/hook-before-upgrade-raster.sql
@@ -38,3 +38,17 @@ CREATE VIEW upgrade_test_raster_view_st_value AS
SELECT
ST_Value(r, ST_MakePoint(0, 0))
FROM upgrade_test_raster;
+
+-- See https://trac.osgeo.org/postgis/ticket/5488
+-- st_clip(raster,integer,geometry,double precision,boolean)
+CREATE VIEW upgrade_test_raster_view_st_clip AS
+SELECT
+ -- signature dropped in PostGIS-2.1.0
+ --st_clip(NULL::raster, NULL::int, NULL::geometry, NULL::float8[], NULL::boolean),
+ -- sig1 new in PostGIS-2.1.0
+ --st_clip(NULL::raster, NULL::int[], NULL::geometry, NULL::float8[], NULL::boolean),
+ st_clip(NULL::raster, NULL::int, NULL::geometry, NULL::float8, NULL::boolean) sig2,
+ st_clip(NULL::raster, NULL::int, NULL::geometry, NULL::boolean) sig3,
+ st_clip(NULL::raster, NULL::geometry, NULL::float8[], NULL::boolean) sig4,
+ st_clip(NULL::raster, NULL::geometry, NULL::float8, NULL::boolean) sig5,
+ st_clip(NULL::raster, NULL::geometry, NULL::boolean) sig6;
-----------------------------------------------------------------------
Summary of changes:
NEWS | 1 +
raster/rt_pg/rtpostgis.sql.in | 14 ++++++++++----
raster/rt_pg/rtpostgis_drop.sql.in | 2 ++
raster/rt_pg/rtpostgis_upgrade_cleanup.sql.in | 9 +++------
raster/test/regress/hooks/hook-after-upgrade-raster.sql | 4 ++++
raster/test/regress/hooks/hook-before-upgrade-raster.sql | 14 ++++++++++++++
6 files changed, 34 insertions(+), 10 deletions(-)
hooks/post-receive
--
PostGIS
More information about the postgis-tickets
mailing list