record statement boundaries
| От | Neil Conway |
|---|---|
| Тема | record statement boundaries |
| Дата | |
| Msg-id | 1140150110.31672.84.camel@localhost.localdomain обсуждение исходный текст |
| Ответы |
Re: record statement boundaries
|
| Список | pgsql-patches |
Attached is a patch from Joachim Wieland that changes the parser to optionally maintain a list of the source texts of the statements in the input query string. Currently debug_query_string is used for that purpose -- this is incorrect when multiple comma-separated statements are concatenated together in a single query string. The patch maintains the list by having the parser record when each statement ends; the lexer's current position is used to determine the source text that corresponds to the current statement. A new global variable "current_statement" has been introduced to replace "debug_query_string" (which has been removed). Two issues/questions: (1) Joachim's patch removes leading and trailing whitespace, and any trailing semi-colon from the statement's text. Is this the right behavior? I'm not sure, I can see an argument for both sides. (2) Some of the logging code (e.g. log_after_parse(), the code for log_min_duration_statement, etc.) needs to be updated to use current_statement rather than the user-submitted query string. I'll do that shortly. Patch from Joachim Wieland, reviewed by Neil Conway. -Neil
Вложения
В списке pgsql-patches по дате отправления: