Re: unlimited undo/journaling - Mailing list pgsql-general

From Richard Huxton
Subject Re: unlimited undo/journaling
Date
Msg-id 200206261816.14954.dev@archonet.com
Whole thread Raw
In response to unlimited undo/journaling  (Carl Meyer <mrbz@gmx.net>)
Responses Re: unlimited undo/journaling  ("Glen Parker" <glenebob@nwlink.com>)
List pgsql-general
On Wednesday 26 Jun 2002 6:43 am, Carl Meyer wrote:

> so what i want is basically an unlimited undo or journalling feature
> for more or less every field.
>
> the idea should be to save the data-difference in some journalling
> table, but i'm not sure how this could be done properly. maybe
> somebody with some experience can help me here ?

Perhaps the simplest system is to have two tables: address and arc_address.
Use "before" triggers on address to copy the old data into arc_address and
stamp it with a version number/timestamp.

I've done something similar to this using a sequence to generate unique
version numbers for me.

The other approach is to turn the process around the other way and have
separate version codes (e.g. EDITING, SUBMITTED, 2002-06-24 etc) and
"publish" the SUBMITTED changes once a day to a "live_address" table. I
currently use something similar to this for a directory where they require
editorial approval, but the editorial bit isn't required.

- Richard Huxton



pgsql-general by date:

Previous
From: Andrew Sullivan
Date:
Subject: Re: How to run multi-processor question
Next
From: Stephan Szabo
Date:
Subject: Re: Strange behaviour of SELECT ... IN