[postgis-tickets] [SCM] PostGIS branch master updated. 3.4.0rc1-64-g3ecd48c7f

git at osgeo.org git at osgeo.org
Tue Aug 29 01:57:48 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  3ecd48c7fa8c97142e00fd4e5467ca22223a0f93 (commit)
      from  99ddb20a49b739c4f6d566d14359b3f8dfa5fd42 (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 3ecd48c7fa8c97142e00fd4e5467ca22223a0f93
Author: Sandro Santilli <strk at kbt.io>
Date:   Mon Aug 28 23:28:56 2023 +0200

    Fix upgrades in presence of views using st_slope(..raster..)
    
    Adds availability info to the function signatures
    
    References #5490 in master branch (3.5.0dev)

diff --git a/raster/rt_pg/rtpostgis.sql.in b/raster/rt_pg/rtpostgis.sql.in
index 5424398fb..e30389607 100644
--- a/raster/rt_pg/rtpostgis.sql.in
+++ b/raster/rt_pg/rtpostgis.sql.in
@@ -3465,11 +3465,15 @@ CREATE OR REPLACE FUNCTION _st_slope4ma(value double precision[][][], pos intege
 	END;
 	$$ LANGUAGE 'plpgsql' IMMUTABLE PARALLEL SAFE;
 
+-- Availability: 2.1.0
 CREATE OR REPLACE FUNCTION st_slope(
-	rast raster, nband integer,
+	rast raster,
+	nband integer,
 	customextent raster,
-	pixeltype text DEFAULT '32BF', units text DEFAULT 'DEGREES',
-	scale double precision DEFAULT 1.0,	interpolate_nodata boolean DEFAULT FALSE
+	pixeltype text DEFAULT '32BF',
+	units text DEFAULT 'DEGREES',
+	scale double precision DEFAULT 1.0,
+	interpolate_nodata boolean DEFAULT FALSE
 )
 	RETURNS raster
 	AS $$
@@ -3525,10 +3529,16 @@ CREATE OR REPLACE FUNCTION st_slope(
 	END;
 	$$ LANGUAGE 'plpgsql' IMMUTABLE PARALLEL SAFE;
 
+-- Availability: 2.0.0
+-- Changed: 2.1.0 added units, scale and interpolate_nodata
+-- Replaces st_slope(raster, integer, text) deprecated in 2.1.0
 CREATE OR REPLACE FUNCTION st_slope(
-	rast raster, nband integer DEFAULT 1,
-	pixeltype text DEFAULT '32BF', units text DEFAULT 'DEGREES',
-	scale double precision DEFAULT 1.0,	interpolate_nodata boolean DEFAULT FALSE
+	rast raster,
+	nband integer DEFAULT 1,
+	pixeltype text DEFAULT '32BF',
+	units text DEFAULT 'DEGREES',
+	scale double precision DEFAULT 1.0,
+	interpolate_nodata boolean DEFAULT FALSE
 )
 	RETURNS raster
 	AS $$ SELECT @extschema at .ST_slope($1, $2, NULL::@extschema at .raster, $3, $4, $5, $6) $$
diff --git a/raster/rt_pg/rtpostgis_drop.sql.in b/raster/rt_pg/rtpostgis_drop.sql.in
index ef6a57ada..72c4e085d 100644
--- a/raster/rt_pg/rtpostgis_drop.sql.in
+++ b/raster/rt_pg/rtpostgis_drop.sql.in
@@ -63,6 +63,11 @@ DROP FUNCTION IF EXISTS ST_Intersects(geometry, raster, integer, boolean);
 -- Removed in 2.1.0, see ticket #5489
 DROP FUNCTION IF EXISTS _st_intersects(raster, geometry, integer);
 
+-- Removed in 2.1.0, see ticket #5490
+DROP FUNCTION IF EXISTS _st_slope4ma(float8[], text, text[]);
+-- Removed in 2.0.0 ? see ticket #5490
+DROP FUNCTION IF EXISTS st_slope(raster, integer, text, boolean);
+
 DROP FUNCTION IF EXISTS ST_Intersection(raster,raster, integer, integer);
 DROP FUNCTION IF EXISTS ST_Intersection(geometry,raster);
 
diff --git a/raster/rt_pg/rtpostgis_upgrade_cleanup.sql.in b/raster/rt_pg/rtpostgis_upgrade_cleanup.sql.in
index fcde527e2..d08f34b59 100644
--- a/raster/rt_pg/rtpostgis_upgrade_cleanup.sql.in
+++ b/raster/rt_pg/rtpostgis_upgrade_cleanup.sql.in
@@ -511,9 +511,6 @@ DROP FUNCTION IF EXISTS _st_contains(geometry, raster, integer);
 DROP FUNCTION IF EXISTS st_addband(raster, raster[], integer);
 
 -- function signatures changed
-DROP FUNCTION IF EXISTS st_slope(raster, integer, text, text, double precision, boolean);
-DROP FUNCTION IF EXISTS st_slope(raster, integer, text, boolean);
-DROP FUNCTION IF EXISTS st_slope(raster, integer, text);
 DROP FUNCTION IF EXISTS st_aspect(raster, integer, text, text, boolean);
 DROP FUNCTION IF EXISTS st_aspect(raster, integer, text, boolean);
 DROP FUNCTION IF EXISTS st_aspect(raster, integer, text);
@@ -567,7 +564,6 @@ DROP FUNCTION IF EXISTS st_asbinary(raster);
 
 DROP FUNCTION IF EXISTS _st_aspect4ma(float8[], text, text[]);
 DROP FUNCTION IF EXISTS _st_hillshade4ma(float8[], text, text[]);
-DROP FUNCTION IF EXISTS _st_slope4ma(float8[], text, text[]);
 
 -- function signature changed
 DROP FUNCTION IF EXISTS st_gdaldrivers();
diff --git a/raster/test/regress/hooks/hook-after-upgrade-raster.sql b/raster/test/regress/hooks/hook-after-upgrade-raster.sql
index bb94684ae..950bf3631 100644
--- a/raster/test/regress/hooks/hook-after-upgrade-raster.sql
+++ b/raster/test/regress/hooks/hook-after-upgrade-raster.sql
@@ -5,5 +5,7 @@ DROP VIEW upgrade_test_raster_view_st_intersects;
 DROP TABLE upgrade_test_raster;
 DROP TABLE upgrade_test_raster_with_regular_blocking;
 
+DROP VIEW upgrade_test_raster_view_st_slope;
+
 -- Drop functions deprecated on upgrade
 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 305bd7d05..92d64879b 100644
--- a/raster/test/regress/hooks/hook-before-upgrade-raster.sql
+++ b/raster/test/regress/hooks/hook-before-upgrade-raster.sql
@@ -60,3 +60,9 @@ SELECT
 	st_intersects(NULL::geometry, NULL::raster, NULL::int) sig3,
 	st_intersects(NULL::raster, NULL::geometry, NULL::int) sig4,
 	st_intersects(NULL::raster, NULL::int, NULL::geometry)  sig5;
+
+-- See https://trac.osgeo.org/postgis/ticket/5490
+CREATE VIEW upgrade_test_raster_view_st_slope AS
+SELECT
+	st_slope(NULL::raster, NULL::int, NULL::raster) sig1,
+	st_slope(NULL::raster, NULL::int) sig2;

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

Summary of changes:
 raster/rt_pg/rtpostgis.sql.in                      | 22 ++++++++++++++++------
 raster/rt_pg/rtpostgis_drop.sql.in                 |  5 +++++
 raster/rt_pg/rtpostgis_upgrade_cleanup.sql.in      |  4 ----
 .../regress/hooks/hook-after-upgrade-raster.sql    |  2 ++
 .../regress/hooks/hook-before-upgrade-raster.sql   |  6 ++++++
 5 files changed, 29 insertions(+), 10 deletions(-)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list