Re: [GENERAL] Triggers and Audit Trail

2005-12-29 Thread Eric E
Hi Marcus, Marcus Couto wrote: Hi all. I'm new with PostgreSQL and this is my first post, so easy on me... :)   I'm thinking of using the native procedural language and triggers to keep an audit trail. For editing changes, we only keep a log of the modified fields and we create

Re: [GENERAL] Triggers and Audit Trail

2005-12-29 Thread Michael Fuhr
On Thu, Dec 29, 2005 at 11:44:26AM -0600, Jeff Amiel wrote: > >Using triggers, is there a way to loop through the fields of the OLD > >and NEW records? I haven't found a generic way to get the field name > >and value that triggered the update other than hard coding if > >statements to compare ev

Re: [GENERAL] Triggers and Audit Trail

2005-12-29 Thread Jeff Amiel
We (my company) never found a way. We ended up writing java code that analyzed the catalog tables that generated the appropriate 'if' statements in the trigger functions for us Actuallywe tinkered with hitting the catalog tables inside our triggers, but for performance reasons, we

Re: [GENERAL] Triggers and Audit Trail

2005-12-29 Thread Jeff Amiel
Using triggers, is there a way to loop through the fields of the OLD and NEW records? I haven't found a generic way to get the field name and value that triggered the update other than hard coding if statements to compare every field of the OLD and NEW records. We (my company) never found a

[GENERAL] Triggers and Audit Trail

2005-12-29 Thread Marcus Couto
Hi all. I'm new with PostgreSQL and this is my first post, so easy on me... :)   I'm thinking of using the native procedural language and triggers to keep an audit trail. For editing changes, we only keep a log of the modified fields and we create a record for each modified value. The audit