Re: Implementing a change log

From: Michael Schuerig <michael(at)schuerig(dot)de>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Implementing a change log
Date: 2005-09-19 00:06:45
Message-ID: 200509190206.46075.michael@schuerig.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Monday 19 September 2005 01:29, Mike Rylander wrote:
> On 9/18/05, Michael Schuerig <michael(at)schuerig(dot)de> wrote:
> > In my current project I have a customer requirement for
> > implementing a change log. This is not just for auditing purposes,
> > rather it is meant to be accessible by users so they can get an
> > overview of the change history of an object. The entire data set is
> > not big, I'm expecting considerably less than 50.000 records.
> > Changes are only made by about 30 human users.
>
> Will you need to tell who made what changes? If so, you'll probably
> want each user to be a fully fledged Postgres users.

Yes, but that's a thing I can easily handle at application/framework
level, whereas using multiple Pg users would be difficult.

[single set vs. working set and audit set]

> Keeping a single set of tables can get pretty complex. You'd need to
> mask each table with a view and a set of rules for working with only
> the newest version of each record. I always set up as separate set
> of audit tables to record the old versions of each row.
>
> > Can anyone relate their experiences with such a thing? Which
> > approaches should I take into consideration?
>
> I blogged about my most recent incarnation of "audit tables" here:
> http://open-ils.org/blog/?p=28 . We don't use Postgres users (we
> have 2 million), but it would be trivial to modify what I've done
> there to work with real PG users or any other particulars of your
> environment.

Thanks. I'll have to read up on PL/PgSQL to understand your code, but
that's something I intended to do anyway.

Michael

--
Michael Schuerig All good people read good books
mailto:michael(at)schuerig(dot)de Now your conscience is clear
http://www.schuerig.de/michael/ --Tanita Tikaram, Twist In My Sobriety

In response to

Browse pgsql-general by date

  From Date Subject
Next Message suresh ramasamy 2005-09-19 04:02:46 help me pls
Previous Message Mike Rylander 2005-09-18 23:29:51 Re: Implementing a change log