Tom Lane wrote:

Andrew Dunstan <[EMAIL PROTECTED]> writes:


If people are happy with suppressing statement logging on a parse error, OK.



I think that's a really, really awful idea. Not infrequently, the postmaster log is the easiest way of debugging applications that are sending bogus SQL. If you fail to log the bogus SQL then you've just cut debuggers off at the knees.

I haven't read the earlier part of the thread yet so I don't know just
what problem you want to solve, but please not this solution.



I had a small bet with myself that you'd say that :-)

I agree with you. Actually, I think I can improve the present situation. Currently, if log_statement is not turned on and you send a query that doesn't parse, all you get is the error trace. By deferring it till right after the parse we can force logging of the query string on a parse error, regardless of that setting (which seems to me to be a very desirable outcome). The only thing is that you will get the error trace first (because it comes from the parser) rather than the query string first.

That should keep you happy, I hope ;-)

(The problem being addressed in this thread is to allow selective logging of DDL/DML statements - see the TODO list. Someone was actually asking for exactly this on irc today.).

cheers

andrew




---------------------------(end of broadcast)--------------------------- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

Reply via email to