[postgis-tickets] r17313 - Schema qualify all geometry casts in raster code, otherwise materialized views do not resture

Regina Obe lr at pcorp.us
Fri Mar 8 10:54:13 PST 2019


Author: robe
Date: 2019-03-08 22:54:12 -0800 (Fri, 08 Mar 2019)
New Revision: 17313

Modified:
   branches/2.5/NEWS
   branches/2.5/raster/rt_pg/rtpostgis.sql.in
Log:
Schema qualify all geometry casts in raster code, otherwise materialized views do not resture
Reference #4291 for PostGIS 2.5.2

Modified: branches/2.5/NEWS
===================================================================
--- branches/2.5/NEWS	2019-03-09 06:32:08 UTC (rev 17312)
+++ branches/2.5/NEWS	2019-03-09 06:54:12 UTC (rev 17313)
@@ -29,6 +29,7 @@
   - #4283, Avoid final point duplicates for circle stroking (Paul Ramsey)
   - #4314, ST_ClipByBox2D: Do not throw when the geometry is invalid (Raúl Marín)
   - #4313, #4307, PostgreSQL 12 compatibility (Laurenz Albe, Raúl Marín)
+  - #4290, Schema qualify geometry casts in raster functions (Regina Obe)
 
 
 

Modified: branches/2.5/raster/rt_pg/rtpostgis.sql.in
===================================================================
--- branches/2.5/raster/rt_pg/rtpostgis.sql.in	2019-03-09 06:32:08 UTC (rev 17312)
+++ branches/2.5/raster/rt_pg/rtpostgis.sql.in	2019-03-09 06:54:12 UTC (rev 17313)
@@ -5968,52 +5968,52 @@
 
 CREATE OR REPLACE FUNCTION raster_left(raster, raster)
     RETURNS bool
-    AS 'select $1::geometry << $2::geometry'
+    AS 'select $1::@extschema at .geometry << $2::@extschema at .geometry'
     LANGUAGE 'sql' IMMUTABLE STRICT _PARALLEL;
 
 CREATE OR REPLACE FUNCTION raster_right(raster, raster)
     RETURNS bool
-    AS 'select $1::geometry >> $2::geometry'
+    AS 'select $1::@extschema at .geometry >> $2::@extschema at .geometry'
     LANGUAGE 'sql' IMMUTABLE STRICT _PARALLEL;
 
 CREATE OR REPLACE FUNCTION raster_overabove(raster, raster)
     RETURNS bool
-    AS 'select $1::geometry |&> $2::geometry'
+    AS 'select $1::@extschema at .geometry |&> $2::@extschema at .geometry'
     LANGUAGE 'sql' IMMUTABLE STRICT _PARALLEL;
 
 CREATE OR REPLACE FUNCTION raster_overbelow(raster, raster)
     RETURNS bool
-    AS 'select $1::geometry &<| $2::geometry'
+    AS 'select $1::@extschema at .geometry &<| $2::@extschema at .geometry'
     LANGUAGE 'sql' IMMUTABLE STRICT _PARALLEL;
 
 CREATE OR REPLACE FUNCTION raster_above(raster, raster)
     RETURNS bool
-    AS 'select $1::geometry |>> $2::geometry'
+    AS 'select $1::@extschema at .geometry |>> $2::@extschema at .geometry'
     LANGUAGE 'sql' IMMUTABLE STRICT _PARALLEL;
 
 CREATE OR REPLACE FUNCTION raster_below(raster, raster)
     RETURNS bool
-    AS 'select $1::geometry <<| $2::geometry'
+    AS 'select $1::@extschema at .geometry <<| $2::@extschema at .geometry'
     LANGUAGE 'sql' IMMUTABLE STRICT _PARALLEL;
 
 CREATE OR REPLACE FUNCTION raster_same(raster, raster)
     RETURNS bool
-    AS 'select $1::geometry ~= $2::geometry'
+    AS 'select $1::@extschema at .geometry ~= $2::@extschema at .geometry'
     LANGUAGE 'sql' IMMUTABLE STRICT _PARALLEL;
 
 CREATE OR REPLACE FUNCTION raster_contained(raster, raster)
     RETURNS bool
-    AS 'select $1::geometry OPERATOR(@extschema at .@) $2::geometry'
+    AS 'select $1::@extschema at .geometry OPERATOR(@extschema at .@) $2::@extschema at .geometry'
     LANGUAGE 'sql' IMMUTABLE STRICT _PARALLEL;
 
 CREATE OR REPLACE FUNCTION raster_contain(raster, raster)
     RETURNS bool
-    AS 'select $1::geometry ~ $2::geometry'
+    AS 'select $1::@extschema at .geometry ~ $2::@extschema at .geometry'
     LANGUAGE 'sql' IMMUTABLE STRICT _PARALLEL;
 
 CREATE OR REPLACE FUNCTION raster_overlap(raster, raster)
     RETURNS bool
-    AS 'select $1::geometry OPERATOR(@extschema at .&&) $2::geometry'
+    AS 'select $1::@extschema at .geometry OPERATOR(@extschema at .&&) $2::@extschema at .geometry'
     LANGUAGE 'sql' IMMUTABLE STRICT _PARALLEL;
 
 -- raster/geometry functions
@@ -6021,19 +6021,19 @@
 -- Availability: 2.0.0
 CREATE OR REPLACE FUNCTION raster_geometry_contain(raster, geometry)
     RETURNS bool
-    AS 'select $1::geometry ~ $2'
+    AS 'select $1::@extschema at .geometry ~ $2'
     LANGUAGE 'sql' IMMUTABLE STRICT _PARALLEL;
 
 -- Availability: 2.0.5
 CREATE OR REPLACE FUNCTION raster_contained_by_geometry(raster, geometry)
     RETURNS bool
-    AS 'select $1::geometry OPERATOR(@extschema at .@) $2'
+    AS 'select $1::@extschema at .geometry OPERATOR(@extschema at .@) $2'
     LANGUAGE 'sql' IMMUTABLE STRICT _PARALLEL;
 
 -- Availability: 2.0.0
 CREATE OR REPLACE FUNCTION raster_geometry_overlap(raster, geometry)
     RETURNS bool
-    AS 'select $1::geometry OPERATOR(@extschema at .&&) $2'
+    AS 'select $1::@extschema at .geometry OPERATOR(@extschema at .&&) $2'
     LANGUAGE 'sql' IMMUTABLE STRICT _PARALLEL;
 
 -- geometry/raster functions
@@ -6041,19 +6041,19 @@
 -- Availability: 2.0.0
 CREATE OR REPLACE FUNCTION geometry_raster_contain(geometry, raster)
     RETURNS bool
-    AS 'select $1 OPERATOR(@extschema at .~) $2::geometry'
+    AS 'select $1 OPERATOR(@extschema at .~) $2::@extschema at .geometry'
     LANGUAGE 'sql' IMMUTABLE STRICT _PARALLEL;
 
 -- Availability: 2.0.5
 CREATE OR REPLACE FUNCTION geometry_contained_by_raster(geometry, raster)
     RETURNS bool
-    AS 'select $1 OPERATOR(@extschema at .@) $2::geometry'
+    AS 'select $1 OPERATOR(@extschema at .@) $2::@extschema at .geometry'
     LANGUAGE 'sql' IMMUTABLE STRICT _PARALLEL;
 
 -- Availability: 2.0.0
 CREATE OR REPLACE FUNCTION geometry_raster_overlap(geometry, raster)
     RETURNS bool
-    AS 'select $1 OPERATOR(@extschema at .&&) $2::geometry'
+    AS 'select $1 OPERATOR(@extschema at .&&) $2::@extschema at .geometry'
     LANGUAGE 'sql' IMMUTABLE STRICT _PARALLEL;
 
 ------------------------------------------------------------------------------
@@ -6629,7 +6629,7 @@
 
 CREATE OR REPLACE FUNCTION ST_DWithin(rast1 raster, nband1 integer, rast2 raster, nband2 integer, distance double precision)
 	RETURNS boolean
-	AS $$ SELECT $1::geometry OPERATOR(@extschema at .&&) @extschema at .ST_Expand(@extschema at .ST_ConvexHull($3), $5) AND $3::@extschema at .geometry OPERATOR(@extschema at .&&) @extschema at .ST_Expand(@extschema at .ST_ConvexHull($1), $5) AND CASE WHEN $2 IS NULL OR $4 IS NULL THEN @extschema at ._ST_dwithin(@extschema at .st_convexhull($1), @extschema at .st_convexhull($3), $5) ELSE @extschema at ._ST_dwithin($1, $2, $3, $4, $5) END $$
+	AS $$ SELECT $1::@extschema at .geometry OPERATOR(@extschema at .&&) @extschema at .ST_Expand(@extschema at .ST_ConvexHull($3), $5) AND $3::@extschema at .geometry OPERATOR(@extschema at .&&) @extschema at .ST_Expand(@extschema at .ST_ConvexHull($1), $5) AND CASE WHEN $2 IS NULL OR $4 IS NULL THEN @extschema at ._ST_dwithin(@extschema at .st_convexhull($1), @extschema at .st_convexhull($3), $5) ELSE @extschema at ._ST_dwithin($1, $2, $3, $4, $5) END $$
 	LANGUAGE 'sql' IMMUTABLE _PARALLEL
 	COST 1000;
 



More information about the postgis-tickets mailing list