Re: Database Design: Maintain Audit Trail of Changes

From: Stevo Slavić <sslavic(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Database Design: Maintain Audit Trail of Changes
Date: 2013-01-08 11:24:35
Message-ID: CAAUywg-SFVZzo+EiAm7=4-1h5LAzJW8qLoBOBqMeLkGYoDRY4w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

In Java world, for this purpose I tend to use JPA/Hibernate with Envers
http://www.jboss.org/envers - db vendor agnostic solution.

Kind regards,
Stevo Slavic.

On Tue, Jan 8, 2013 at 6:32 AM, Craig Ringer <craig(at)2ndquadrant(dot)com> wrote:

> On 4/01/2013 12:09 AM, Adrian Klaver wrote:
> > On 01/03/2013 07:38 AM, Rich Shepard wrote:
> >
> >>
> >> The middleware of the application needs to check this table when data
> >> are
> >> to be viewed in the UI and present only the current row contents. A
> >> separate
> >> view would display a history of changes for that row.
> >>
> >> All thoughts, suggestions, and recommendations based on your
> >> expertise and
> >> experience will be most welcome.
> >
> > As a matter of course I include fields to record the timestamp and
> > user for insert of records and last update of record on my tables.
> >
> > For a relatively simple solution see this blog post I put up this summer:
> >
> > http://aklaver.org/wordpress/2012/06/23/postgres-and-hstore/
> >
> > I have since expanded that to include updates by using TG_OP to
> > determine the operation being done on the table.
> >
> > There is also pg_audit
> > :
> > https://github.com/jcasanov/pg_audit
>
> Additionally, this is an audit trigger I was using internally and
> generalized:
>
> http://wiki.postgresql.org/wiki/Audit_trigger_91plus
>
> --
> Craig Ringer http://www.2ndQuadrant.com/
> PostgreSQL Development, 24x7 Support, Training & Services
>
>
>
> --
> Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message ac@hsk.hk 2013-01-08 11:52:52 Re: PostgreSQL 9.2 and PGBOUNCER
Previous Message J. Hondius 2013-01-08 11:05:26 Re: lc_time not working? Solved.