[postgis-tickets] [SCM] PostGIS branch master updated. 3.4.0rc1-62-ge1b7db454

git at osgeo.org git at osgeo.org
Mon Aug 28 13:04:43 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  e1b7db45486fea9cb3c0be8d58cbd2a785b631f4 (commit)
      from  ce07fb3430cf32ef575c30d7aa55c7e2b3156de2 (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 e1b7db45486fea9cb3c0be8d58cbd2a785b631f4
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 master branch (3.5.0dev)

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:
 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 ++++++++++++++
 5 files changed, 33 insertions(+), 10 deletions(-)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list