Re: Database Design: Maintain Audit Trail of Changes - Mailing list pgsql-general

From Rich Shepard
Subject Re: Database Design: Maintain Audit Trail of Changes
Date
Msg-id alpine.LNX.2.00.1301030915540.5088@salmo.appl-ecosys.com
Whole thread Raw
In response to Re: Database Design: Maintain Audit Trail of Changes  (Bèrto ëd Sèra <berto.d.sera@gmail.com>)
List pgsql-general
On Thu, 3 Jan 2013, Bèrto ëd Sèra wrote:

> if it's a strict legal requirement you may want to enforce it with a
> trigger system, so that each time a record is inserted/updated/deleted
> you create an exact copy of it in a historical table, that has the
> original record plus data about who performed the operation, when,
> from which IP, maybe a comment field, etc. So your actual table
> remains limited in size and it's performing well, while the size
> problem is local to the audit logs.

Bèrto,

   That's in line with Adrian's suggestion and certainly worth doing. It's
not a required legal requirement but provides the company (and potential
investors) with assurance that data have not been manipulated.

> You also want to use triggers to disable updates and deletes on this
> historical table, for a matter of additional security (you might end up
> needing a procedure to trim it, however, if it grows out of affordable
> bounds).

   Yes, the history table will be read-only to all users; writing done by
triggers only.

Much appreciated,

Rich



pgsql-general by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [ADMIN] Unable to reload postgresql.conf without restarting
Next
From: Fabrízio de Royes Mello
Date:
Subject: Re: Database Design: Maintain Audit Trail of Changes