Re: Statements with syntax errors are not logged

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Statements with syntax errors are not logged
Date: 2006-10-19 15:33:17
Message-ID: 13986.1161271997@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
> Tom Lane wrote:
>> To some extent the logging
>> settings are only meant to capture successfully executed statements

> Then it should be changed to log *only* successfully executed statements
> and explicitly documented as such.

Well, maybe we should do that. It'd be relatively easy to handle the
ALL case before parsing and the other cases after in the "simple query"
code path, but I don't see any nice way to make it work in the
parse/bind/execute code path. As the code stands in HEAD, we don't
normally log parse/bind messages at all, just execute messages, because
there's no way to avoid serious redundancy/log-bloat/confusion otherwise.
Another attractive aspect is that we could merge duration logging with
statement reporting rather than having two separate log messages come
out in some cases.

The other thing we'd want to do is try a bit harder to ensure that
debug_query_string is always valid, so that one could be certain that
the combination of log_min_error_statement and log_statement = ALL
tells all. bind/execute messages don't currently bother to set
debug_query_string properly, but I think that could be fixed easily.

Comments?

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2006-10-19 15:47:53 Re: Additional stats for Relations
Previous Message tomas 2006-10-19 15:18:44 Re: Statements with syntax errors are not logged