Re: defer statement logging until after parse - Mailing list pgsql-patches

From Andrew Dunstan
Subject Re: defer statement logging until after parse
Date
Msg-id 405187A5.4060906@dunslane.net
Whole thread Raw
In response to Re: defer statement logging until after parse  (Bruce Momjian <pgman@candle.pha.pa.us>)
Responses Re: defer statement logging until after parse
List pgsql-patches

Bruce Momjian wrote:

>The problem I see with this patch is that it doesn't print the error
>query on a syntax error.  That seems wrong.
>

It does print it. In fact the example I gave below which is from a real
trace shows it being printed. It is just printed after the error message
rather than before.

You solution doesn't appear to address the problem of what to do if they
ask for only DDL and one of those generates a syntax error.

cheers

andrew

>
>I think you should print the query before parsing if they are asking for
>all queries to be logged, and print them after parsing if they want only
>DDL or DDL and data modification queries.  I realize that duplicates
>some function calls, but I don't see any other way.
>
>---------------------------------------------------------------------------
>
>Andrew Dunstan wrote:
>
>
>>The attached patch is for review, not application. It defers logging
>>statements until after they have been parsed. There should be no
>>observable difference in behaviour if there is a successful parse, and
>>on error the following traces appear:
>>
>>  line:3 ERROR:  syntax error at or near "se3d2" at character 1
>>  line:4 LOG:  parse error in statement: se3d2 aaa;
>>
>>Basically, I want to know that this will not break anything, and if so I
>>will use it as the basis for a selective statement logging facility,
>>based on the command tag(s) of the parsed statement(s), and
>>incorporating Greg Stark's suggesion of a "syntax error" logging level.
>>
>>cheers
>>
>>andrew
>>
>>
>>
>
>
>
>


pgsql-patches by date:

Previous
From: Fabien COELHO
Date:
Subject: Re: [HACKERS] notice about costly ri checks (3)
Next
From: Bruce Momjian
Date:
Subject: Re: int8 fix for win32