Thread: logging

logging

From
Nabil Sayegh
Date:
Hi all,

for my next project I need to log everything that modifies the db.
I could do this in the database abstraction layer of my application but
that could be problematic:

e.g.:

INSERT INTO tab VALUES (now());
or
INSERT INTO tab VALUES (random());
or
DELETE FROM tab WHERE id_tab=round(random()*10);

1) Is there a way for me to see AFTER the query succeeded what exactly
has been done

e.g.

INSERT INTO tab VALUES (now());
becomes
INSERT INTO tab VALUES ('22.08.2003 00:36:41.887795 CEST');

OR

DELETE FROM tab WHERE id_tab=round(random()*10);
will become
DELETE FROM tab WHERE id_tab=3;

2) The other solution would be even nicer

Can postgresql do such a log itself ?

In the end I want to be able to start from the very beginning of the db
and redo everything step by step.

TIA
--
 e-Trolley Sayegh & John, Nabil Sayegh
 Tel.: 0700 etrolley /// 0700 38765539
 Fax.: +49 69 8299381-8
 PGP : http://www.e-trolley.de