Re: selective statement logging

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: selective statement logging
Date: 2004-03-10 23:51:48
Message-ID: 404FAA14.1010307@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:

>Andrew Dunstan <andrew(at)dunslane(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tatsuo Ishii 2004-03-11 01:49:53 Re: [PATCHES] NO WAIT ...
Previous Message Bruce Momjian 2004-03-10 23:44:41 Re: selective statement logging