Re: selective statement logging - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: selective statement logging
Date
Msg-id 404FAA14.1010307@dunslane.net
Whole thread Raw
In response to Re: selective statement logging  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: selective statement logging
List pgsql-hackers
Tom Lane wrote:

>Andrew Dunstan <andrew@dunslane.net> 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





pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: selective statement logging
Next
From: Tatsuo Ishii
Date:
Subject: Re: [PATCHES] NO WAIT ...