[postgis-devel] [PostGIS] #343: History Table Enhancements

PostGIS trac at osgeo.org
Sun Sep 4 16:02:59 PDT 2011


#343: History Table Enhancements
----------------------------+-----------------------------------------------
 Reporter:  pimpaa          |       Owner:  pimpaa       
     Type:  defect          |      Status:  new          
 Priority:  medium          |   Milestone:  PostGIS 2.0.0
Component:  postgis         |     Version:  trunk        
 Keywords:  History Tables  |  
----------------------------+-----------------------------------------------

Comment(by pimpaa):

 Hello guys,

 I've discovered a huge problem with the rule system that it may invalidate
 this current implementation in favor of triggers.

 Here is the outline:

 imagine this:

 CREATE TABLE test(
 id serial not null primary key);

 SELECT * FROM ADDGEOMETRYCOLUMN('public','test','the_geom',-1,'POINT'2);

 SELECT * FROM POSTGIS_CREATE_HISTORY('public','test','the_geom');

 insert into test values (1,ST_GEOMFROMTEXT('POINT(1 1)'));

 Our rule system works out beautiful in this scenario, because we are
 passing a known value to our id. The rules will write everything correctly
 to the database.

 but imagine this insert

 insert into test values(DEFAULT,ST_GEOMFROMTEXT('POINT(1 1)'));

 In this case the value passed to the rules is nextval, therefore, leaping
 an id, breaking the system (the logged id for this record is 2, instead of
 1);

 I think we should move on to triggers, since as I know it, there is no way
 to workaround this rule behavior.

 This is not a critical module, but I'm asking for your opinion guys and
 gals.

 I prefer to not have this functionality for one month or two while I
 rewrite this module with triggers than showcase something that is half-
 broken.

 Thoughts?

-- 
Ticket URL: <http://trac.osgeo.org/postgis/ticket/343#comment:17>
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