Обсуждение: Auditing a database
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
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
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
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.
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 needto 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