[postgis-tickets] [SCM] PostGIS branch stable-3.1 updated. 3.1.8-3-gc0a84b916

git at osgeo.org git at osgeo.org
Tue Feb 14 22:52:28 PST 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  c0a84b9163630aef92b483063ee438cc5c617fc4 (commit)
      from  b206f31fe0a365364aadfec08a7c6e46e71c0a83 (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 c0a84b9163630aef92b483063ee438cc5c617fc4
Author: Regina Obe <lr at pcorp.us>
Date:   Wed Feb 15 01:13:13 2023 -0500

    Schema qualify raster functions used in
    raster check constraint functions.
    
    References #5338 for PostGIS 3.1.9

diff --git a/NEWS b/NEWS
index 2578a6eaa..9e6aa53ce 100644
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,8 @@ PostGIS 3.1.9dev
 xxxx/xx/xx
 
 * Bug Fixes
+  - #5338, Dump/Restore of raster table fails on
+           enforce_coverage_tile_rast constraint (Regina Obe)
 
 PostGIS 3.1.8
 2022/11/12
diff --git a/raster/rt_pg/rtpostgis.sql.in b/raster/rt_pg/rtpostgis.sql.in
index b04a03996..5efba28a0 100644
--- a/raster/rt_pg/rtpostgis.sql.in
+++ b/raster/rt_pg/rtpostgis.sql.in
@@ -5777,7 +5777,7 @@ CREATE OR REPLACE FUNCTION st_samealignment(
 	ulx2 double precision, uly2 double precision, scalex2 double precision, scaley2 double precision, skewx2 double precision, skewy2 double precision
 )
 	RETURNS boolean
-	AS $$ SELECT st_samealignment(st_makeemptyraster(1, 1, $1, $2, $3, $4, $5, $6), st_makeemptyraster(1, 1, $7, $8, $9, $10, $11, $12)) $$
+	AS $$ SELECT @extschema at .st_samealignment(@extschema at .st_makeemptyraster(1, 1, $1, $2, $3, $4, $5, $6), @extschema at .st_makeemptyraster(1, 1, $7, $8, $9, $10, $11, $12)) $$
 	LANGUAGE 'sql' IMMUTABLE STRICT PARALLEL SAFE;
 
 -- Availability: 2.1.0
@@ -5801,11 +5801,11 @@ CREATE OR REPLACE FUNCTION _st_samealignment_transfn(agg agg_samealignment, rast
 			agg.aligned := NULL;
 		ELSE
 			IF agg.refraster IS NULL THEN
-				m := ST_Metadata(rast);
-				agg.refraster := ST_MakeEmptyRaster(1, 1, m.upperleftx, m.upperlefty, m.scalex, m.scaley, m.skewx, m.skewy, m.srid);
+				m := @extschema at .ST_Metadata(rast);
+				agg.refraster := @extschema at .ST_MakeEmptyRaster(1, 1, m.upperleftx, m.upperlefty, m.scalex, m.scaley, m.skewx, m.skewy, m.srid);
 				agg.aligned := TRUE;
 			ELSIF agg.aligned IS TRUE THEN
-				agg.aligned := ST_SameAlignment(agg.refraster, rast);
+				agg.aligned := @extschema at .ST_SameAlignment(agg.refraster, rast);
 			END IF;
 		END IF;
 		RETURN agg;
@@ -5850,16 +5850,16 @@ CREATE OR REPLACE FUNCTION st_iscoveragetile(rast raster, coverage raster, tilew
 		tile integer[];
 		edge integer[];
 	BEGIN
-		IF NOT ST_SameAlignment(rast, coverage) THEN
+		IF NOT @extschema at .ST_SameAlignment(rast, coverage) THEN
 			RAISE NOTICE 'Raster and coverage are not aligned';
 			RETURN FALSE;
 		END IF;
 
-		_rastmeta := ST_Metadata(rast);
-		_covmeta := ST_Metadata(coverage);
+		_rastmeta := @extschema at .ST_Metadata(rast);
+		_covmeta := @extschema at .ST_Metadata(coverage);
 
 		-- get coverage grid coordinates of upper-left of rast
-		cr := ST_WorldToRasterCoord(coverage, _rastmeta.upperleftx, _rastmeta.upperlefty);
+		cr := @extschema at .ST_WorldToRasterCoord(coverage, _rastmeta.upperleftx, _rastmeta.upperlefty);
 
 		-- rast is not part of coverage
 		IF
@@ -6812,7 +6812,7 @@ CREATE OR REPLACE FUNCTION _add_raster_constraint_srid(rastschema name, rasttabl
 
 		sql := 'ALTER TABLE ' || fqtn
 			|| ' ADD CONSTRAINT ' || quote_ident(cn)
-			|| ' CHECK (st_srid('
+			|| ' CHECK (@extschema at .st_srid('
 			|| quote_ident($3)
 			|| ') = ' || attr || ')';
 
@@ -6897,7 +6897,7 @@ CREATE OR REPLACE FUNCTION _add_raster_constraint_scale(rastschema name, rasttab
 
 		sql := 'ALTER TABLE ' || fqtn
 			|| ' ADD CONSTRAINT ' || quote_ident(cn)
-			|| ' CHECK (round(st_scale' || $4 || '('
+			|| ' CHECK (round(@extschema at .st_scale' || $4 || '('
 			|| quote_ident($3)
 			|| ')::numeric, 10) = round(' || text(attr) || '::numeric, 10))';
 		RETURN  @extschema at ._add_raster_constraint(cn, sql);
@@ -7125,7 +7125,7 @@ CREATE OR REPLACE FUNCTION _add_raster_constraint_alignment(rastschema name, ras
 
 		sql := 'ALTER TABLE ' || fqtn ||
 			' ADD CONSTRAINT ' || quote_ident(cn) ||
-			' CHECK (st_samealignment(' || quote_ident($3) || ', ''' || attr || '''::raster))';
+			' CHECK (@extschema at .st_samealignment(' || quote_ident($3) || ', ''' || attr || '''::raster))';
 		RETURN  @extschema at ._add_raster_constraint(cn, sql);
 	END;
 	$$ LANGUAGE 'plpgsql' VOLATILE STRICT
@@ -7287,7 +7287,7 @@ CREATE OR REPLACE FUNCTION _add_raster_constraint_coverage_tile(rastschema name,
 
 		sql := 'ALTER TABLE ' || fqtn ||
 			' ADD CONSTRAINT ' || quote_ident(cn) ||
-			' CHECK (st_iscoveragetile(' || quote_ident($3) || ', ''' || _covrast || '''::raster, ' || _tilewidth || ', ' || _tileheight || '))';
+			' CHECK (@extschema at .st_iscoveragetile(' || quote_ident($3) || ', ''' || _covrast || '''::raster, ' || _tilewidth || ', ' || _tileheight || '))';
 		RETURN  @extschema at ._add_raster_constraint(cn, sql);
 	END;
 	$$ LANGUAGE 'plpgsql' VOLATILE STRICT
@@ -7419,7 +7419,7 @@ CREATE OR REPLACE FUNCTION _raster_constraint_info_pixel_types(rastschema name,
 
 CREATE OR REPLACE FUNCTION _raster_constraint_pixel_types(rast raster)
 	RETURNS text[] AS
-	$$ SELECT array_agg(pixeltype)::text[] FROM  @extschema at .ST_BandMetaData($1, ARRAY[]::int[]); $$
+	$$ SELECT pg_catalog.array_agg(pixeltype)::text[] FROM  @extschema at .ST_BandMetaData($1, ARRAY[]::int[]); $$
 	LANGUAGE 'sql' STABLE STRICT;
 
 CREATE OR REPLACE FUNCTION _add_raster_constraint_pixel_types(rastschema name, rasttable name, rastcolumn name)
@@ -7507,7 +7507,7 @@ CREATE OR REPLACE FUNCTION _raster_constraint_info_nodata_values(rastschema name
 -- Changed: 2.2.0
 CREATE OR REPLACE FUNCTION _raster_constraint_nodata_values(rast raster)
 	RETURNS numeric[] AS
-	$$ SELECT array_agg(round(nodatavalue::numeric, 10))::numeric[] FROM @extschema at .ST_BandMetaData($1, ARRAY[]::int[]); $$
+	$$ SELECT pg_catalog.array_agg(pg_catalog.round(nodatavalue::numeric, 10))::numeric[] FROM @extschema at .ST_BandMetaData($1, ARRAY[]::int[]); $$
 	LANGUAGE 'sql' IMMUTABLE STRICT PARALLEL SAFE;
 
 CREATE OR REPLACE FUNCTION _add_raster_constraint_nodata_values(rastschema name, rasttable name, rastcolumn name)
@@ -7598,7 +7598,7 @@ CREATE OR REPLACE FUNCTION _raster_constraint_info_out_db(rastschema name, rastt
 
 CREATE OR REPLACE FUNCTION _raster_constraint_out_db(rast raster)
 	RETURNS boolean[] AS
-	$$ SELECT array_agg(isoutdb)::boolean[] FROM @extschema at .ST_BandMetaData($1, ARRAY[]::int[]); $$
+	$$ SELECT pg_catalog.array_agg(isoutdb)::boolean[] FROM @extschema at .ST_BandMetaData($1, ARRAY[]::int[]); $$
 	LANGUAGE 'sql' IMMUTABLE STRICT PARALLEL SAFE;
 
 CREATE OR REPLACE FUNCTION _add_raster_constraint_out_db(rastschema name, rasttable name, rastcolumn name)

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

Summary of changes:
 NEWS                          |  2 ++
 raster/rt_pg/rtpostgis.sql.in | 30 +++++++++++++++---------------
 2 files changed, 17 insertions(+), 15 deletions(-)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list