<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>Message</TITLE>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.6000.16788" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=149332016-05012009><FONT face=Arial color=#0000ff size=2>This
is exactly how I version data. I use a trigger function in PostgreSQL to
detect column changes and insert the OLD.<geometry column> with the
OLD.<pkey_column> to another table (try <table name>_history. The
target table has columns with default values for recording the date/time and
user that performed the transaction. </FONT></SPAN></DIV>
<DIV><SPAN class=149332016-05012009><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=149332016-05012009><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=149332016-05012009><FONT face=Arial color=#0000ff size=2>create
function tr_geom_trans() returns trigger as $$<BR>BEGIN<BR> insert
into mytable_history (table_id, old_geom, mod_date, mod_user) SELECT OLD.oid,
OLD.the_geom, now(), current_user;<BR> return
NEW;<BR>END;</FONT></SPAN></DIV>
<DIV> </DIV>
<DIV><SPAN class=149332016-05012009><FONT face=Arial color=#0000ff
size=2>$$<BR>language "plpgsql" volatile<BR></FONT></SPAN></DIV>
<DIV><SPAN class=149332016-05012009><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<BLOCKQUOTE
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
<DIV></DIV>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left><FONT
face=Tahoma size=2>-----Original Message-----<BR><B>From:</B>
postgis-users-bounces@postgis.refractions.net
[mailto:postgis-users-bounces@postgis.refractions.net] <B>On Behalf Of
</B>Brian Sanjeewa Rupasinghe<BR><B>Sent:</B> Monday, January 05, 2009 5:44
AM<BR><B>To:</B> postgis-users@postgis.refractions.net<BR><B>Subject:</B>
[postgis-users] problem with topology<BR><BR></FONT></DIV>I have a land parcel
(polygon) stored in postGIS with a ceratin feature ID, say FID = 100. I want
to split this polygon into two building topology for new two polygons, and
sending the original polygon (i.e FID = 100) into history with the use of a
trigger. Is it possible? Polygon split is done by <BR>a GIS software that is
connected to PostGIS.<BR><BR>SANJEEWA<BR></BLOCKQUOTE></BODY></HTML>