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

From Adrian Maier
Subject Re: Statements with syntax errors are not logged
Date
Msg-id cd30ef8c0610200013m276e081cn212a1fe3986f2f8c@mail.gmail.com
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  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-hackers
On 10/19/06, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Peter Eisentraut <peter_e@gmx.net> writes:
> > When setting log_statement = 'all', statements that fail parsing are not
> > logged.
> > Is that intentional?
>
> The 'mod' and 'ddl' settings obviously can't be handled until after
> basic parsing.  We could create a completely separate code path for
> 'all' but I'm not sure I see the point.

Hello,

Sometimes it can be very useful to be able to see even the incorrect
commands:  for example when the incorrect query is generated by an
application or library that you haven't written yourself .

A few days ago I was experimenting with Lazarus (an object-pascal
based IDE similar to Delphi)  and I was getting some unexpected syntax
errors.  In order to debug the problem i had to hack the sources of the
postgres unit and add some writeln's right before the PQexec calls .

It would have been much more convenient to see the bad queries in
the logs ...


-- 
Adrian Maier


pgsql-hackers by date:

Previous
From: Andreas Pflug
Date:
Subject: Re: adminpack and pg_catalog
Next
From: Markus Schaber
Date:
Subject: Re: Syntax bug? Group by?