[EMAIL PROTECTED] wrote:
>
> > > I need a logging utility for postgresql server.
> > This will (probably) be addressed in WAL (write-ahead logging(?)), due to
> > appear eventually but, as we found out the other day, not so soon :( .
> Can i write any log anywhere? My first goal was to duplicate the
> database, for more safety. There are many another way, to do this.
> But I expected more info from the log. I need an userid to all of the
> database events.
> I have some users who more likely use psql, so it's futile to write this in
> my client.
> Probaly where enough to log usesysid, tid, and query string for each
> statement. is this possible?
>
> best regards
>
> --
> nek;(
>
> ************
I'd like to define a few terms here - my word usages may not match
other people's:
1. Logging - capturing and recording data about events happening
in the system.
2. Journalling - capturing database transactions
3. Mirroring - exactly replicating database activity in another location.
Each of these techniques has pros and cons. I consider mirroring to be the
best way to guarantee data integrity and possibly the lowest overhead, since
in theory, all that's require is to clone the write, update and delete
operations to an alternate destination. Practice is often less simple, of
course.
Journalling and logging exchange exactness of the final product for more
information about how that product was produced. I distinguish in that I expect
a journal to be a binary record of database activity and logging to be
(ultimately) text and more descriptive of activities not related to the
database itself, such as minutes logged on per user (sure, don't YOU bill
that way? :), filesystem errors noted (and how they were handled), performance
stats, and generally anything else that would be good to know above and
beyond raw debug info.
What little I know of WAL is that it goes somewhere around the journalling/
mirroring level. From what you say, logging may be more what you want.
In that regard, you might want to check out the pgsql-patches for the
"Industrial-Strength Logging" preview. Should this ever be integrated
onto PostgreSQL, I'd expect (in fact, I RESERVED) a couple of log messages
to be used to track SQL requests with the ability to determine what user
made them.
regards,
Tim Holloway
************