O'Reilly logo

PostgreSQL 9 Administration Cookbook by Hannu Krosing, Simon Riggs

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Auditing data changes

This recipe provides different ways to collect changes to data contained in the tables for auditing purposes.

Getting ready

Determine the following:

  • Do you need to audit all changes or only some?
  • What information about the changes do you need to collect: just the fact of change?
  • New value of a field or tuple, is old value also needed here?
  • Is it enough to record the user doing the change, or is the IP address and other connection information also needed?
  • How secure (tamper-proof) must the auditing info be? For example, does it need to be kept separately, away from the database being audited?

Based on answers to the aforementioned questions, you can start selecting the right auditing method from the ones presented next.

How to do ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required