Re: Statements with syntax errors are not logged - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Statements with syntax errors are not logged
Date
Msg-id 5560.1161297128@sss.pgh.pa.us
Whole thread Raw
In response to Re: Statements with syntax errors are not logged  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Statements with syntax errors are not logged  ("Jim C. Nasby" <jim@nasby.net>)
Re: Statements with syntax errors are not logged  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-hackers
I wrote:
> Peter Eisentraut <peter_e@gmx.net> writes:
>> Then it should be changed to log *only* successfully executed statements 
>> and explicitly documented as such.

> Well, maybe we should do that.

I fooled around with doing that, and while it's a simple code change,
I realized that it's got a fairly serious drawback: if you get an error
in a parameterized query, there's no way at all to find out via logging
what the parameters were that it failed on.  That seems to negate one
of the main uses of the parameter-value-logging code that we put so much
work into in this cycle.

So I'm inclined to leave the behavior as-is.  The documentation for
log_statement already says
Note: Statements that generate syntax errors are not logged. Setlog_min_error_statement to error to log such
statements.
 

We could improve the wording here, perhaps, but ultimately this is a
documentation issue.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [COMMITTERS] pgsql: Work around reported problem that AIX's getaddrinfo() doesn't
Next
From: Tom Lane
Date:
Subject: Re: New CRC algorithm: Slicing by 8