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

PostGIS trac at osgeo.org
Wed Jul 13 17:49:27 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):

 Heres is the new version for the history table implementation.

 Changes:

  - Altered the return of the functions to be a varchar, to comply with
 other similar functions. My idea here was to do this at the lowest
 possible level and join all information on the top level functions, but
 I'm quite busy these days, so I hardcoded some of the return information.
 There's room for improvement here, as I said, collecting more detailed
 information and outputting to the user.

  - Fixed the bug reported by Regina. UPDATEs are logged as UPDATED,
 deletes as DELETED and INSERTS as INSERT (I'm thinking INSERTED here would
 fit better). I'm open to suggestions.

  - The current_version number in history table should point at the current
 history version which those old records point to. This is some sort of
 bug. Now they are pointing to the current primary key on the actual table,
 so we get a lot of duplicated information. The PK is already listed, so
 it's not necessary.

  - I've created one single test. The plan is to split it up into more
 tests. Advice would be great.

  - The functions now are:

 postgis_create_history(schema,table,pk field) - this will create the
 history table for the first time and start logging;

 postgis_enable_history(schema,table) - enables history logging for a
 certain table if this table is already listed on historic_information (ie.
 postgis_create_history already ran at some point). this will recreate the
 logging rules.

 postgis_disable_history(schema,table) - disables history logging for a
 table that is listed in historic_information. this function only updates
 the historic_information table and drops the logging rules.

 postgis_drop_history(schema,table) - this will purge all history
 information for a certain table. this will drop historic table and delete
 it's records from geometry_columns and historic_information.

 I would like to hear your comments and critics.

 Thanks

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