From: Bborie Park Date: Tue, 18 Dec 2012 20:42:05 +0000 (+0000) Subject: Tweaked UpdateRasterSRID() to drop/add coverage tile as needed X-Git-Tag: 2.1.0beta2~283 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c7921b194d25afc5d17f8a8d435b019da8c53f3e;p=postgis Tweaked UpdateRasterSRID() to drop/add coverage tile as needed git-svn-id: http://svn.osgeo.org/postgis/trunk@10853 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/raster/rt_pg/rtpostgis.sql.in.c b/raster/rt_pg/rtpostgis.sql.in.c index 6c0ea61af..e3c38b6a5 100644 --- a/raster/rt_pg/rtpostgis.sql.in.c +++ b/raster/rt_pg/rtpostgis.sql.in.c @@ -7801,6 +7801,7 @@ CREATE OR REPLACE FUNCTION _UpdateRasterSRID( schema name; sql text; srid integer; + ct boolean; BEGIN -- validate schema schema := NULL; @@ -7841,6 +7842,13 @@ CREATE OR REPLACE FUNCTION _UpdateRasterSRID( srid := new_srid; END IF; + -- drop coverage tile constraint + -- done separately just in case constraint doesn't exist + ct := _raster_constraint_info_coverage_tile(schema, $2, $3); + IF ct IS TRUE THEN + PERFORM _drop_raster_constraint_coverage_tile(schema, $2, $3); + END IF; + -- drop SRID, extent, alignment constraints PERFORM DropRasterConstraints(schema, $2, $3, 'extent', 'alignment', 'srid'); @@ -7861,6 +7869,11 @@ CREATE OR REPLACE FUNCTION _UpdateRasterSRID( -- add SRID constraint PERFORM AddRasterConstraints(schema, $2, $3, 'srid', 'extent', 'alignment'); + -- add coverage tile constraint if needed + IF ct IS TRUE THEN + PERFORM _add_raster_constraint_coverage_tile(schema, $2, $3); + END IF; + RETURN TRUE; END; $$ LANGUAGE 'plpgsql' VOLATILE;