Re: Cleaning up PREPARE query strings?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Cleaning up PREPARE query strings?
Дата
Msg-id 928501.1766593260@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Cleaning up PREPARE query strings?  (Julien Rouhaud <rjuju123@gmail.com>)
Ответы Re: Cleaning up PREPARE query strings?
Список pgsql-hackers
Julien Rouhaud <rjuju123@gmail.com> writes:
> I'm attaching a POC patch to fix that behavior by teaching PREPARE to clean the
> passed query text the same way as pg_stat_statements.

This patch invalidates all the location fields in the parsed query:
they could not be used to generate sane error cursors referencing the
truncated string.  I'm not sure how many places try to generate such
errors post-parsing, but it's more than zero, and I've long had
ambitions of trying to extend that substantially (e.g, allowing
execution-time errors from functions to point at the relevant function
call).

Certainly the patch could be extended to update all those fields,
but that increases its complexity very significantly.  I doubt
that it's worth it.  My reaction to your example is more like
"if that bothers you, don't do it that way".

            regards, tom lane



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