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 22:32:08
Message-ID: 5560.1161297128@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I wrote:
> Peter Eisentraut <peter_e(at)gmx(dot)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. Set
log_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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tux P 2006-10-20 00:30:40 PgSQL users quota
Previous Message Tom Lane 2006-10-19 21:56:21 Re: [COMMITTERS] pgsql: Work around reported problem that AIX's getaddrinfo() doesn't