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

2018-12-29 Thread Michael Paquier
On Sun, Dec 30, 2018 at 02:40:57PM +0900, Michael Paquier wrote: > Attached is the set of tests I used which has some regression tests. > The results won't fail with HEAD at 4203842a, and will generate some > diffs after e0ef136d as Pavel's patch has changed the generated > output. And of course

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

2018-12-29 Thread Michael Paquier
On Fri, Dec 28, 2018 at 04:50:11PM +0900, Michael Paquier wrote: > Okay, that makes sense, now I got your point. Perhaps somebody else > has an opinion to offer or has an objection with the proposed change? And committed this one, after playing more with the instrumentation callbacks and

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

2018-12-27 Thread Michael Paquier
On Fri, Dec 28, 2018 at 07:57:45AM +0100, Pavel Stehule wrote: > There is only one difference - the plugin routine stmt_begin and stmt_end > is called for line 3. Nothing less, nothing more. Thanks for the detailed explanation! With your simple example it is easy enough to see the difference,

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

2018-12-27 Thread Pavel Stehule
pá 28. 12. 2018 v 3:26 odesílatel Michael Paquier napsal: > On Wed, Dec 26, 2018 at 07:02:04AM +0100, Pavel Stehule wrote: > > is called two times, what is not expected, if you don't know some about > > this inconsistency. > > > > So it is reason, why I don't think so current behave is correct.

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

2018-12-27 Thread Michael Paquier
On Wed, Dec 26, 2018 at 07:02:04AM +0100, Pavel Stehule wrote: > is called two times, what is not expected, if you don't know some about > this inconsistency. > > So it is reason, why I don't think so current behave is correct. On second > hand, the impact is very small - only few extensions uses

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

2018-12-25 Thread Pavel Stehule
st 26. 12. 2018 v 6:09 odesílatel Michael Paquier napsal: > 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. >

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

2018-12-25 Thread Michael Paquier
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

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

2018-12-18 Thread Pavel Stehule
st 19. 12. 2018 v 6:45 odesílatel Michael Paquier napsal: > On Sun, Dec 16, 2018 at 10:33:38AM +0100, Pavel Stehule wrote: > > 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

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

2018-12-18 Thread Michael Paquier
On Sun, Dec 16, 2018 at 10:33:38AM +0100, Pavel Stehule wrote: > 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

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

2018-12-16 Thread Pavel Stehule
po 19. 11. 2018 v 19:37 odesílatel Pavel Stehule 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; >