Home > Archive > PostgreSQL Discussion > December 2005 > just an inconvenience, or.... : failed queries don't appear in the log anymore since v8.?.?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author just an inconvenience, or.... : failed queries don't appear in the log anymore since v8.?.?
Frank van Vugt

2005-12-28, 9:23 am

Hi,

I may be overlooking some option here, but somewhere between the v7 series and
the current v8.1.1 that I'm using, failed queries stopped being logged, only
the error message appears in the log (config option log_statement = all).

I.e. executing

select 1 2;

will result in just the logging of

ERROR: syntax error at or near "2" at character 10

Earlier versions logged the failed query as well, which made it a lot easier
to cut&paste queries generated by applications in development in order to
hunt down the problem.

- psql follows up on the error by printing the line where it occured

- setting log_error_verbosity to 'verbose' doesn't log the query itself either


Is there a way to get the failed query into the log, or should it have been
there in the first place?





--
Best,




Frank.

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Tom Lane

2005-12-28, 11:23 am

Frank van Vugt <ftm.van.vugt@foxi.nl> writes:
> I may be overlooking some option here, but somewhere between the v7 series and
> the current v8.1.1 that I'm using, failed queries stopped being logged, only
> the error message appears in the log (config option log_statement = all).


See log_min_error_statem
ent ...

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match

Vivek Khera

2005-12-28, 11:23 am


On Dec 28, 2005, at 9:46 AM, Frank van Vugt wrote:

> I may be overlooking some option here, but somewhere between the v7
> series and
> the current v8.1.1 that I'm using, failed queries stopped being
> logged, only
> the error message appears in the log (config option log_statement =
> all).
>
> I.e. executing
>
> select 1 2;
>
> will result in just the logging of
>
> ERROR: syntax error at or near "2" at character 10
>


You want to set

log_min_error_statem
ent = error


in your postgresql.conf file. The default value of 'panic' seems
less than useful to me.


---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Jim C. Nasby

2005-12-28, 1:23 pm

decibel=# set log_min_error_statem
ent=error;
SET
decibel=# select 1 2;
ERROR: syntax error at or near "2" at character 10
LINE 1: select 1 2;
^
decibel=# \q
decibel@phonebook.1[11:47]~:21%tail -n 2 /opt/local/var/log/pgsql8/postgres.log
ERROR: syntax error at or near "2" at character 10
STATEMENT: select 1 2;
decibel@phonebook.1[11:47]~:22%

On Wed, Dec 28, 2005 at 03:46:23PM +0100, Frank van Vugt wrote:
> Hi,
>
> I may be overlooking some option here, but somewhere between the v7 series and
> the current v8.1.1 that I'm using, failed queries stopped being logged, only
> the error message appears in the log (config option log_statement = all).
>
> I.e. executing
>
> select 1 2;
>
> will result in just the logging of
>
> ERROR: syntax error at or near "2" at character 10
>
> Earlier versions logged the failed query as well, which made it a lot easier
> to cut&paste queries generated by applications in development in order to
> hunt down the problem.
>
> - psql follows up on the error by printing the line where it occured
>
> - setting log_error_verbosity to 'verbose' doesn't log the query itself either
>
>
> Is there a way to get the failed query into the log, or should it have been
> there in the first place?
>
>
>
>
>
> --
> Best,
>
>
>
>
> Frank.
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: explain analyze is your friend
>


--
Jim C. Nasby, Sr. Engineering Consultant jnasby@pervasive.com
Pervasive Software http://pervasive.com work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com