trigger or logging

From: Jay Vee <jvsrvcs(at)gmail(dot)com>
To: pgsql-general General <pgsql-general(at)postgresql(dot)org>
Subject: trigger or logging
Date: 2013-09-13 16:57:07
Message-ID: CADq_mb-GkDsuuuQFaXJy=WKd9GuUka7rL2hB5NzNVeYVUpwP3g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Before running a script (invoked by .sh that will call stored procs which
may invoke other triggers), I want to capture every change made in the
database which includes the field value before the update and the field
value after the update and also capture all inserts.

With this data, I would be able to write a script that would reverse the
database to all previous values.

This may be possible with a trigger or a set of triggers but I would need
some direction here and to think of all scenarios.

before insert ( capture data that will be inserted ),
if the insert ivokes triggers that insert additional rows or updates rows I
would want to capture this.

on any update: trigger to capture the before value and the after value only
on the field values that change.

Any help or examples would be greatly appreciated.

J.V.

Browse pgsql-general by date

  From Date Subject
Next Message Patrick Dung 2013-09-13 17:04:32 Re: Major upgrade of PostgreSQL and MySQL
Previous Message David Noel 2013-09-13 16:47:34 Re: Small PosgreSQL locking function request - with bounty