[postgis-tickets] [PostGIS] #2485: [raster]: raster constraints prevent raster data from restoring

PostGIS trac at osgeo.org
Tue Dec 9 07:36:18 PST 2014


#2485: [raster]: raster constraints prevent raster data from restoring
----------------------+-----------------------------------------------------
 Reporter:  rdunklau  |       Owner:  dustymugs    
     Type:  defect    |      Status:  new          
 Priority:  critical  |   Milestone:  PostGIS 2.0.7
Component:  raster    |     Version:  trunk        
 Keywords:            |  
----------------------+-----------------------------------------------------

Comment(by robe):

 I have yet another hackish solution to this I came across by accident.  If
 you create a constraint as NOT VALID, it will check the constraint for
 future inserts/updates to the table, but will not check existing data and
 will also not check the constraint during load.

 I still need to verify, but I think doing a


 ALTER TABLE sometable
   ADD CONSTRAINT enforce_num_bands_rast CHECK (st_numbands(rast) = 3) NOT
 VALID;

 might do the trick and maybe we can include that as a load option.  it
 would makeloading much faster too since it wouldn't have to validate on
 load, but puts a bit of trust on user's understanding of their data.

-- 
Ticket URL: <http://trac.osgeo.org/postgis/ticket/2485#comment:34>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.


More information about the postgis-tickets mailing list