Re: defer statement logging until after parse

Поиск
Список
Период
Сортировка
От Andrew Dunstan
Тема Re: defer statement logging until after parse
Дата
Msg-id 405187A5.4060906@dunslane.net
обсуждение исходный текст
Ответ на Re: defer statement logging until after parse  (Bruce Momjian <pgman@candle.pha.pa.us>)
Ответы Re: defer statement logging until after parse  (Bruce Momjian <pgman@candle.pha.pa.us>)
Список 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 по дате отправления:

Предыдущее
От: Fabien COELHO
Дата:
Сообщение: Re: [HACKERS] notice about costly ri checks (3)
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: int8 fix for win32