[postgis-devel] [PostGIS] #180: History table example implementation
PostGIS
trac at osgeo.org
Tue Jul 7 07:22:22 PDT 2009
#180: History table example implementation
--------------------------+-------------------------------------------------
Reporter: pramsey | Owner: pimpaa
Type: enhancement | Status: assigned
Priority: medium | Milestone: postgis 1.5.0
Component: postgis | Version:
Resolution: | Keywords:
--------------------------+-------------------------------------------------
Comment (by pimpaa):
Hello everyone,
I´ve came up with a solution for this ticket, altought there is room for
improvent.
How this works?
Execute the SQL files in any PostGIS database.
It will create the table historic_information on the public schema (need
direction with this).
execute the following sp to create a historic table of any type of
geometry:
select
create_history_table(schema,table_to_log,primary_field,geometry_field,geometry_type,ndims,SRID);
this will create the table foo_history on the same schema as the original
table. i will create all the rules necessary to log the updates, inserts
and deletes to the original table.
in the history table we have a current version field, which will log which
is the ID of the current version of that feature.
I did not tested it out extensively.
Thanks for all the help, and please give the usual comment and critics.
George
--
Ticket URL: <http://trac.osgeo.org/postgis/ticket/180#comment:7>
PostGIS <http://trac.osgeo.org/postgis/>
PostGIS
More information about the postgis-devel
mailing list