Re: [HACKERS] BUG: pg_stat_statements query normalization issues with combined queries

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [HACKERS] BUG: pg_stat_statements query normalization issues with combined queries
Дата
Msg-id 27543.1485438137@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: [HACKERS] BUG: pg_stat_statements query normalization issues withcombined queries  (Craig Ringer <craig.ringer@2ndquadrant.com>)
Ответы Re: [HACKERS] BUG: pg_stat_statements query normalization issues withcombined queries  (Craig Ringer <craig.ringer@2ndquadrant.com>)
Список pgsql-hackers
Craig Ringer <craig.ringer@2ndquadrant.com> writes:
> One suggestion: it's currently non-obvious that ProcessUtility_hook
> gets called with the full text of all parts of a multi-statement.

OK, we can improve that ...

>   The same query string may be passed to multiple invocations of ProcessUtility
>   if a utility statement in turn invokes other utility statements, or if the
>   user supplied a query string containing multiple semicolon-separated
>   statements in a single protocol message. It is also possible for the query
>   text to contain other non-utility-statement text like comments, empty
>   statements, and plannable statements. Callers that use the queryString
>   should use pstmt->stmt_location and pstmt->stmt_len to extract the text for
>   the statement of interest and should guard against re-entrant invocation.

Not sure about the reference to re-entrancy.  It's not especially relevant
to query texts AFAICS, and wouldn't a utility statement know darn well if
it was doing something that could end up invoking another instance of
itself?
        regards, tom lane



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Jesper Pedersen
Дата:
Сообщение: Re: [HACKERS] Microvacuum support for Hash Index
Следующее
От: Robert Haas
Дата:
Сообщение: Re: [HACKERS] pg_ls_dir & friends still have a hard-coded superuser check