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

From Michael Paquier
Subject Re: plpgsql plugin - stmt_beg/end is not called for top level blockof statements
Date
Msg-id 20181226050928.GH2234@paquier.xyz
Whole thread Raw
In response to Re: plpgsql plugin - stmt_beg/end is not called for top level blockof statements  (Pavel Stehule <pavel.stehule@gmail.com>)
Responses Re: plpgsql plugin - stmt_beg/end is not called for top level blockof statements  (Pavel Stehule <pavel.stehule@gmail.com>)
List pgsql-hackers
On Wed, Dec 19, 2018 at 07:04:50AM +0100, Pavel Stehule wrote:
> I can imagine some tracking extension, that will do some
> initializations on plpgsql_stmt_block statement hook - but the most
> important will not be called ever.

I was just studying this stuff and reviewing this patch with fresh
eyes, and it seems to me that it is actually incorrect.  This changes
the execution logic so as stmt_beg and stmt_end are called
additionally each time a function, a trigger or an event trigger is
executed.  If one looks closely at the code, he/she could notice that
func_beg and func_end are already present as hook points to watch what
is happening in the execution, as these are here to give entry points
for execution functions, so it seems to me that we don't need extra
watch calls as proposed, because there is already everything needed,
and that the current points are correct.
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Tatsuro Yamada
Date:
Subject: Re: Tab completion for ALTER INDEX|TABLE ALTER COLUMN SET STATISTICS
Next
From: Michael Paquier
Date:
Subject: Re: Tab completion for ALTER INDEX|TABLE ALTER COLUMN SET STATISTICS