Re: unlimited undo/journaling

From: Richard Huxton <dev(at)archonet(dot)com>
To: Carl Meyer <mrbz(at)gmx(dot)net>, pgsql-general(at)postgresql(dot)org
Subject: Re: unlimited undo/journaling
Date: 2002-06-26 17:16:14
Message-ID: 200206261816.14954.dev@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Andrew Sullivan 2002-06-26 17:21:09 Re: How to run multi-processor question
Previous Message Richard Huxton 2002-06-26 17:07:37 Re: Kylix