Re: Re: [COMMITTERS] pgsql: Adjust things so that the query_string of a cached plan and the
В списке pgsql-hackers по дате отправления:
| От | Tom Lane |
|---|---|
| Тема | Re: Re: [COMMITTERS] pgsql: Adjust things so that the query_string of a cached plan and the |
| Дата | |
| Msg-id | 7781.1231372693@sss.pgh.pa.us обсуждение |
| Ответ на | Re: Re: [COMMITTERS] pgsql: Adjust things so that the query_string of a cached plan and the (Tom Lane <tgl@sss.pgh.pa.us>) |
| Список | pgsql-hackers |
I wrote:
> The good thing about using debug_query_string is that "the current
> client query" is well-defined and easy to explain. I'm worried
> whether using ActivePortal isn't likely to result in a rather
> implementation-dependent behavior that changes from release to release.
In fact, it *is* rather implementation-dependent. Compare what you'll
get from these two functions:
create function plpgsqlf() returns text as '
begin return current_query();
end' language plpgsql;
create function plpgsqlf2() returns text as '
declare t text;
begin for t in select current_query() loop return t; end loop;
end' language plpgsql;
My testing says that if we use ActivePortal then "select plpgsqlf()"
returns "select plpgsqlf()" but "select plpgsqlf2()" returns
" select current_query()", ie, the query associated with the implicit
plpgsql cursor. I'm interested to know how you'll document that.
regards, tom lane
В списке pgsql-hackers по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера