Re: plpgsql plugin - stmt_beg/end is not called for top level blockof statements

Поиск
Список
Период
Сортировка
От Pavel Stehule
Тема Re: plpgsql plugin - stmt_beg/end is not called for top level blockof statements
Дата
Msg-id CAFj8pRDOHHeJSWZTRoSK4Eo16TRZQxzxzKu9h6KLRvnmsE0F4A@mail.gmail.com
обсуждение исходный текст
Ответ на plpgsql plugin - stmt_beg/end is not called for top level block of statements  (Pavel Stehule <pavel.stehule@gmail.com>)
Ответы Re: plpgsql plugin - stmt_beg/end is not called for top level blockof statements  (Michael Paquier <michael@paquier.xyz>)
Список pgsql-hackers


po 19. 11. 2018 v 19:37 odesílatel Pavel Stehule <pavel.stehule@gmail.com> napsal:
Hi

I am playing with plpgsql profiling and and plpgsql plugin API. I found so callback stmt_beg and stmt_end was not called for top statement due direct call exec_stmt_block function.

<-->estate.err_text = NULL;
<-->estate.err_stmt = (PLpgSQL_stmt *) (func->action);
<-->rc = exec_stmt_block(&estate, func->action);
<-->if (rc != PLPGSQL_RC_RETURN)
<-->{
<--><-->estate.err_stmt = NULL;
<--><-->estate.err_text = NULL;

Isn't better to call exec_stmt there? Then plpgsql plugin function will be called really for every plpgsql statement.

Now, the statement's hook is not called for every plpgsql_stmt_block statement. It is not big issue, but it is not consistent - and this inconsistency should be repaired inside extension. Better to be consistent and every plpgsql statement call identically.

patch attached - all regress tests passed. This patch has a effect only on plpgsql extensions.

Regards

Pavel


Regards

Pavel
Вложения

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

Предыдущее
От: Pavel Stehule
Дата:
Сообщение: Re: proposal: plpgsql pragma statement
Следующее
От: Erik Rijkers
Дата:
Сообщение: Re: select limit error in file_fdw