trigger or logging - Mailing list pgsql-general

From Jay Vee
Subject trigger or logging
Date
Msg-id CADq_mb-GkDsuuuQFaXJy=WKd9GuUka7rL2hB5NzNVeYVUpwP3g@mail.gmail.com
Whole thread Raw
List 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.

pgsql-general by date:

Previous
From: David Noel
Date:
Subject: Re: Small PosgreSQL locking function request - with bounty
Next
From: Patrick Dung
Date:
Subject: Re: Major upgrade of PostgreSQL and MySQL