From: Chris <dmagick@gmail.com>
To: Colin Ross <colinross@gmail.com>
Cc: pgsql-php@postgresql.org
Subject: Re: Application Design: Where to implement historical revisions of objects
Date: Thu, 24 May 2007 10:34:04 +1000
Message-ID: <4654DD7C.3000103@gmail.com> (raw)
In-Reply-To: <fd3e08f30705231310m46901107gf7f44df6bd78a845@mail.gmail.com>
References: <fd3e08f30705231310m46901107gf7f44df6bd78a845@mail.gmail.com>
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/
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-php@postgresql.org
Cc: dmagick@gmail.com, colinross@gmail.com
Subject: Re: Application Design: Where to implement historical revisions of objects
In-Reply-To: <4654DD7C.3000103@gmail.com>
References: <fd3e08f30705231310m46901107gf7f44df6bd78a845@mail.gmail.com> <4654DD7C.3000103@gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox