[postgis-devel] [PostGIS] #1319: [raster] Make raster_columns a view and AddRasterColumn enforce more

PostGIS trac at osgeo.org
Tue Nov 22 07:46:26 PST 2011


#1319: [raster] Make raster_columns a view and AddRasterColumn enforce more
----------------------------+-----------------------------------------------
 Reporter:  robe            |       Owner:  robe         
     Type:  task            |      Status:  new          
 Priority:  high            |   Milestone:  PostGIS 2.0.0
Component:  postgis raster  |     Version:  trunk        
 Keywords:                  |  
----------------------------+-----------------------------------------------

Comment(by robe):

 Pierre,  let me clarify the benefits I see:

 Constraining/view has 3 key benefits
 1) Its fast to inspect a constraint rather than the raw data so the view
 querying is fairly fast
 2) The view is always in synch with the actual table, because no one can
 add data that violates the constraints unless they remove a constraint
 3)If they were to remove a constraint, then the view would register NULL
 for that piece of info.

 where it lacks elegance that typmod has is that its still at least 2 step
 process
 requiring maintenance functions.

 e.g.

 {{{
 -- Option 1 --
 CREATE TABLE myrasttable(rid serial primary key, rast raster);
 INSERT DATA ...

 SELECT populate_raster_columns('myrasttable'::regclass);
 }}}

 {{{
 --- Option 2 --
 CREAT TABLE myrasttable(rid serial primary key);
 SELECT AddRasterColumn(.....);
 INSERT DATA ... (though you can insert after since the constraints have
 already been established by the AddrasterColumn call)
 }}}

-- 
Ticket URL: <http://trac.osgeo.org/postgis/ticket/1319#comment:3>
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-devel mailing list