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: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: plpgsql plugin - stmt_beg/end is not called for top level block of statements
Date: 2018-11-19 18:37:41
Message-ID: CAFj8pRArEANsaUjo5in9_iQt0vKf9ecwDAmsdN_EBwL13ps12A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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.

Regards

Pavel

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2018-11-19 18:54:31 Re: [HACKERS] generated columns
Previous Message Michael Banck 2018-11-19 18:11:19 Re: pgsql: Add TAP tests for pg_verify_checksums