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

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: plpgsql plugin - stmt_beg/end is not called for top level block of statements
Date: 2018-12-19 06:04:50
Message-ID: CAFj8pRDMfpHxj_Rv=pEf-V-daHuJWRKMciRp-T5Z7Diygmb2VA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

st 19. 12. 2018 v 6:45 odesílatel Michael Paquier <michael(at)paquier(dot)xyz>
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 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.
>
> I can see the inconsistency in the code, still do you have a simple
> plpgsql extension where it is possible to see the difference in
> behavior? This involves execution of functions, triggers and event
> triggers, and exec_stmt_block is used since the beginning of times.
>

What I know, there is only few plpgsql's extensions - 3 variations on
debugger support, 1 profiler and plpgsql_check. It was not a issue, because
these extensions doesn't hit this problem.

When I wrote a coverity check to plpgsql_check I found it. The outer BEGIN
has a property of usual plpgsql statement - positive lineno, but it was not
executed newer.

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.

Regards

Pavel

--
> Michael
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2018-12-19 06:38:16 Re: ToDo: show size of partitioned table
Previous Message Michael Paquier 2018-12-19 05:45:29 Re: plpgsql plugin - stmt_beg/end is not called for top level block of statements