Auditing a database

Started by Germán Hüttemann Arzaalmost 19 years ago5 messagesgeneral
Jump to latest
#1Germán Hüttemann Arza
ghuttemann@gmail.com

Hi,

I am developing a web application for auditing tables from a postgresql
database.

My question is: when an update occurrs in the base table, should I insert in
the auditing table the new record or the old one?

I was first inserting the new one but a job partner, who are testing the
application suggested that probably would be better to insert the old record
because it is simpler to follow the trace of updates.

What you suggest?

Regards,

--
Germán Hüttemann Arza
CNC - Centro Nacional de Computación
UNA - Universidad Nacional de Asunción
Campus Universitario, San Lorenzo - Paraguay
http://www.cnc.una.py  - Tel.: 595 21 585550

#2Richard Huxton
dev@archonet.com
In reply to: Germán Hüttemann Arza (#1)
Re: Auditing a database

Germ�n H�ttemann Arza wrote:

Hi,

I am developing a web application for auditing tables from a postgresql
database.

My question is: when an update occurrs in the base table, should I insert in
the auditing table the new record or the old one?

Old - you already have the new version in the main table.

Before you spend too long working on this though, I'd search for "audit"
on www.pgfoundry.org

--
Richard Huxton
Archonet Ltd

#3Kenneth Downs
ken@secdat.com
In reply to: Germán Hüttemann Arza (#1)
Re: Auditing a database

Ask the question: can I make sure I always have a complete trail? If
you insert the old row, you will always have the old values and the
table itself holds the new values.

Germ�n H�ttemann Arza wrote:

Hi,

I am developing a web application for auditing tables from a postgresql
database.

My question is: when an update occurrs in the base table, should I insert in
the auditing table the new record or the old one?

I was first inserting the new one but a job partner, who are testing the
application suggested that probably would be better to insert the old record
because it is simpler to follow the trace of updates.

What you suggest?

Regards,

--
Kenneth Downs
Secure Data Software, Inc.
www.secdat.com www.andromeda-project.org
631-379-7200 Fax: 631-689-0527

#4Dave Page
dpage@pgadmin.org
In reply to: Germán Hüttemann Arza (#1)
Re: Auditing a database

Germ�n H�ttemann Arza wrote:

Hi,

I am developing a web application for auditing tables from a postgresql
database.

My question is: when an update occurrs in the base table, should I insert in
the auditing table the new record or the old one?

I was first inserting the new one but a job partner, who are testing the
application suggested that probably would be better to insert the old record
because it is simpler to follow the trace of updates.

What you suggest?

Both?

Regards, Dave.

#5Andreas 'ads' Scherbaum
adsmail@wars-nicht.de
In reply to: Kenneth Downs (#3)
Re: Auditing a database

Hello all,

On Thu, 19 Apr 2007 09:27:33 -0400
Kenneth Downs <ken@secdat.com> wrote:

Ask the question: can I make sure I always have a complete trail? If
you insert the old row, you will always have the old values and the
table itself holds the new values.

In tablelog (http://pgfoundry.org/projects/tablelog/) i decided to have both rows, the old and the new one. So i don't need to lookup the current state in the original table and be able to fetch any data from one single audit table.

Germán Hüttemann Arza wrote:

Your quoting ... well, sucks ;-)

Kind regards

--
Andreas 'ads' Scherbaum
Deutsche PostgreSQL Usergroup: http://www.pgug.de
DPWN: http://ads.wars-nicht.de/blog/categories/18-PWN