Re: LOG table changes ...

Поиск
Список
Период
Сортировка
От Anton Nikiforov
Тема Re: LOG table changes ...
Дата
Msg-id 40FBBFB0.5000703@nikiforov.ru
обсуждение исходный текст
Ответ на LOG table changes ...  ("raptor@tvskat.net" <raptor@tvskat.net>)
Список pgsql-general
raptor@tvskat.net wrote:
> hi,
>
> I want to track every change made to several tables...and was wondering
> what is the best way... What are my thoughts at the moment are to make a
> table like this :
>
> id, table_name, field_name, old_value, new_value, timestamp
>
> and triggers to do the logging.
> but this will probably generate alot of traffic (not so worrying at the moment)
>
> As I side effect of this I want to be able to make a snapshot of the TABLE at specified time..
> any ideas on this too...
>
> tia.
>
> P.S. Other way would be to make a duplicate table and transffer the whole record, but
> dont think this is a good solution
Hello!
I did almost the same by writing a trigger on PL/Ruby that is logging
all table changes + user + other information into the log table in XML
format (the format of  the table on which updation/insertion trigger is
fiered is absolutley free and not required to be defind at "compile time").
So you still can view all data changes and build the database but my way
  is cappable to view who when changed what, but to build a database
actual at exact moment is difficult enough but still possible.

Best regards,
Anton

Вложения

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

Предыдущее
От: "raptor@tvskat.net"
Дата:
Сообщение: LOG table changes ...
Следующее
От: "raptor@tvskat.net"
Дата:
Сообщение: enumerated type..