Am 2010-09-09 20:31, schrieb Rob Richardson:
> So far in this thread, I haven't seen anybody answer what I consider to
> be a very important question about the original poster's requirements:
> Why are you updating the history table????
> If you update the history table, you lose old history. Instead, I think
> you should be adding a new record to the history table for every
> alteration made to the old one. The history table would have to contain
> a field for the type of change that was made (insert, update or delete).
thx for all the answers so far
I wasn't thinking about updating the history table.
"adding a field in the audit table which contains the names of all the
fields which changed" meant adding this field to the history table
originally, so it gets filled along with all the others when every
change to a row is recorded. HOW to "easily" get the values to put there
i don't know, i don't even know if this approach is sensible at all.
the solutions in the other posts require me to know the field to audit
in advance. i'm searching for a "easy" solution where "everything" is
logged and i can make simple queries to the history table for changes in
i must admit i'm not too familiar with triggers and even functions, so
maybe i'm heading in the wrong direction or i'm simply asking too much.
i just thought that i can't be the only one who was looking for this
kind of functionality (which of course doesn't mean that there is an
i hope i could make myself clear
In response to
pgsql-novice by date
|Next:||From: Rodrigo Quezada||Date: 2010-09-09 22:13:12|
|Subject: Getting The Last Entry|
|Previous:||From: Richard Broersma||Date: 2010-09-09 18:37:44|
|Subject: Re: logging table changes|