Re: logging table changes

Поиск
Список
Период
Сортировка
От Matthias Leopold
Тема Re: logging table changes
Дата
Msg-id 4C894985.7000006@aic.at
обсуждение исходный текст
Ответ на Re: logging table changes  ("Rob Richardson" <Rob.Richardson@rad-con.com>)
Список pgsql-novice
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).
>
> RobR
>

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
ANY field.

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
"easy" solution)

i hope i could make myself clear

matthias





В списке pgsql-novice по дате отправления:

Предыдущее
От: Richard Broersma
Дата:
Сообщение: Re: logging table changes
Следующее
От: Rodrigo Quezada
Дата:
Сообщение: Getting The Last Entry