RE: [HACKERS] RE: [GENERAL] Transaction logging - Mailing list pgsql-hackers

From Todd Graham Lewis
Subject RE: [HACKERS] RE: [GENERAL] Transaction logging
Date
Msg-id Pine.LNX.4.04.9903061623150.3829-100000@reflections.eng.mindspring.net
Whole thread Raw
In response to RE: [HACKERS] RE: [GENERAL] Transaction logging  (Michael Davis <michael.davis@prevuenet.com>)
List pgsql-hackers
On Fri, 5 Mar 1999, Michael Davis wrote:

> All things considered, I would be content with logging insert, update, and
> delete instructions to an external file.  It would be extremely valuable to
> allow this log file to exist on a mounted file system so it could be stored
> on a different machine.  It would also be valuable to have the user name
> originating the transaction, a date time stamp, and possibly a transaction
> number as optional fields appended to the logs.

I agree that this would be an _excellent_ first cut at logging.  Yes, if
you have "insert time()", then you will have problems, but for the majority
of applications, what is suggested above will be good enough, and I'm a big
anti-fan of letting the best be the enemy of the good.

> Maybe these optional fields
> could be added to the sql statement as comments?  Are comments allowed in a
> sql statement?  This would allow for a visual of what has been  updated,
> when it was updated, and who performed the update.  At a later date this
> could be extended or an alternate means of logging can be added.  My vote
> will always go for additional options.

Just define a document format for the logs which allow for this data.
If you do it in XML (GNOME and mozilla both have great free xml libraries
available), then all of the normal, nasty issues, like whitespace  and
parsing, are completely taken care of for you.  Just a suggestion.

--
Todd Graham Lewis            32�49'N,83�36'W          (800) 719-4664, x2804
******Linux******         MindSpring Enterprises      tlewis@mindspring.net

"A pint of sweat will save a gallon of blood."          -- George S. Patton


pgsql-hackers by date:

Previous
From: The Hermit Hacker
Date:
Subject: a "bug" in v6.4.3 ...
Next
From: Todd Graham Lewis
Date:
Subject: CVS access?