Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

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



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/



Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group