Re: audit table containing Select statements submitted - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: audit table containing Select statements submitted
Date
Msg-id 4464CE6D.5030003@dunslane.net
Whole thread Raw
In response to Re: audit table containing Select statements submitted  (Josh Berkus <josh@agliodbs.com>)
Responses Re: audit table containing Select statements submitted
List pgsql-hackers
Josh Berkus wrote:
>
> Secondly, you can use the log.  We've discussed on this list making it 
> possible to log in CSV, XML or other database-digestable format. 
> Unfortuantely, there doesn't appear to be much momentum behind that; I 
> don't know that anyone is writing any code presently.  Sponsorship?
>

Well, let's think about it some first, before we line up $$ :-)

We really have 3 bits of the log: the prefix, the tag, and the message.

Turning the prefix into whatever is needed is in the hands of the user. 
We could provide a corresponding log_line_suffix to allow XML element 
completion if necessary. The tag could likewise easily be XMLized (or 
CSVized, or whatever). The real problem is the message, which is now 
from the logging code's point of view basically an opaque string. 
Changing that would be a massive undertaking, especially when you think 
of the effect on the translators. And first we would need to come up 
with a set of fields, or several sets of fields, that we wanted to use. 
The reason I haven't gone down this road, and just did log_line_prefix, 
is that it strikes me as too inflexible. I think postprocessing is 
probably a better way to go, and just leave the messages opaque from 
postgres' point of view. If someone has a better proposal, let's see an 
example of how all the various messages would be handled.

cheers

andrew


pgsql-hackers by date:

Previous
From: "Joshua D. Drake"
Date:
Subject: Re: audit table containing Select statements submitted
Next
From: Josh Berkus
Date:
Subject: Re: audit table containing Select statements submitted