Re: Application Design: Where to implement historical revisions of objects

From: Chris <dmagick(at)gmail(dot)com>
To: Colin Ross <colinross(at)gmail(dot)com>
Cc: pgsql-php(at)postgresql(dot)org
Subject: Re: Application Design: Where to implement historical revisions of objects
Date: 2007-05-24 00:34:04
Message-ID: 4654DD7C.3000103@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-php

Colin Ross wrote:
> Summary:
> In a situation where the business model dictates that a certain entity
> or class of entities should support the viewing of and differencing of
> historical revisions of the data (read properties) contained in the
> entity should be supported. Should the logic for the creation and
> viewing of this historical information be implemented in the application
> itself

If you are only going to be using postgres, do it with a trigger so you
don't have to remember to do it in the application (it's quite easy to
forget something like this).

If you have to support other databases as well, then make sure they
support triggers.

If you have to use a database that doesn't support triggers, then that
makes the decision for you (eg supporting mysql 4.1).

If you have to do it in the app, it's still quite easy:

insert into history_table (...) select x,y,z from orig_table where id='X'

Done :)

--
Postgresql & php tutorials
http://www.designmagick.com/

In response to

Browse pgsql-php by date

  From Date Subject
Next Message Michelle Konzack 2007-05-25 17:41:08 Re: Application Design: Where to implement historical revisions of objects
Previous Message Colin Ross 2007-05-23 20:10:42 Application Design: Where to implement historical revisions of objects