]> granicus.if.org Git - postgis/commitdiff
use @ operator instead of ST_CoveredBy(). Ticket #2822
authorBborie Park <bkpark at ucdavis.edu>
Mon, 7 Jul 2014 15:39:14 +0000 (15:39 +0000)
committerBborie Park <bkpark at ucdavis.edu>
Mon, 7 Jul 2014 15:39:14 +0000 (15:39 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@12752 b70326c6-7e19-0410-871a-916f4a2858ee

NEWS
raster/rt_pg/rtpostgis.sql.in

diff --git a/NEWS b/NEWS
index dda9b5eebf2a5adc7c5bb38fc195c2d41f48fc14..bc4680e752a3e5883b2401feab2d5ce8bf311b40 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -80,6 +80,8 @@ PostGIS 2.2.0
            like geometry extent
   - #2802, ST_MapAlgebra checks for valid callback function return value
   - #2803, ST_MapAlgebra handles no userarg and STRICT callback function
+  - #2822, Use @ operator instead of ST_CoveredBy() for raster
+           max extent constraint
 
  * Code refactoring *
 
index 725d0f7c57ff6ac353ecfe83ac12bdc850a1fdc2..72285c7e14bf2470a6accbd1fb6dd24ced493f70 100644 (file)
@@ -7048,7 +7048,7 @@ CREATE OR REPLACE FUNCTION _drop_raster_constraint_blocksize(rastschema name, ra
 CREATE OR REPLACE FUNCTION _raster_constraint_info_extent(rastschema name, rasttable name, rastcolumn name)
        RETURNS geometry AS $$
        SELECT
-               trim(both '''' from split_part(trim(split_part(s.consrc, ',', 2)), '::', 1))::geometry
+               trim(both '''' from split_part(trim(split_part(s.consrc, ' @ ', 2)), '::', 1))::geometry
        FROM pg_class c, pg_namespace n, pg_attribute a, pg_constraint s
        WHERE n.nspname = $1
                AND c.relname = $2
@@ -7057,7 +7057,7 @@ CREATE OR REPLACE FUNCTION _raster_constraint_info_extent(rastschema name, rastt
                AND s.connamespace = n.oid
                AND s.conrelid = c.oid
                AND a.attnum = ANY (s.conkey)
-               AND s.consrc LIKE '%st_coveredby(st_envelope(%';
+               AND s.consrc LIKE '%st_envelope(% @ %';
        $$ LANGUAGE sql STABLE STRICT
   COST 100;
 
@@ -7085,9 +7085,9 @@ CREATE OR REPLACE FUNCTION _add_raster_constraint_extent(rastschema name, rastta
 
                sql := 'ALTER TABLE ' || fqtn
                        || ' ADD CONSTRAINT ' || quote_ident(cn)
-                       || ' CHECK (st_coveredby(st_envelope('
+                       || ' CHECK (st_envelope('
                        || quote_ident($3)
-                       || '), ''' || attr || '''::geometry))';
+                       || ') @ ''' || attr || '''::geometry)';
                RETURN _add_raster_constraint(cn, sql);
        END;
        $$ LANGUAGE 'plpgsql' VOLATILE STRICT