[postgis-tickets] [SCM] PostGIS branch stable-3.4 updated. 3.4.0-7-gc1f65ad87
git at osgeo.org
git at osgeo.org
Tue Aug 29 02:00:11 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 c1f65ad8768deb96353cf4fe26dab85241ba3e49 (commit)
from df07c2995551ca80157333a9b366261871476f82 (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 c1f65ad8768deb96353cf4fe26dab85241ba3e49
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
Closes #5490 in 3.4 branch (3.4.1dev)
diff --git a/NEWS b/NEWS
index af10acfe9..5f81aaf6c 100644
--- a/NEWS
+++ b/NEWS
@@ -6,6 +6,8 @@ To take advantage of all SFCGAL featurs, SFCGAL 1.4.1+ is needed.
* Bug Fixes *
+ - #5490, Fix upgrade with view using st_slope(raster, ...)
+ (Sandro Santilli)
- #5489, Fix upgrade with view using st_intersects(raster, ...)
(Sandro Santilli)
- #5488, Fix upgrade with view using st_clip(raster, ...)
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:
NEWS | 2 ++
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 ++++++
6 files changed, 31 insertions(+), 10 deletions(-)
hooks/post-receive
--
PostGIS
More information about the postgis-tickets
mailing list