enhancing plpgsql debug api - hooks on statements errors and function errors

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: enhancing plpgsql debug api - hooks on statements errors and function errors
Date: 2023-04-25 08:27:59
Message-ID: CAFj8pRDGQo4thzrFJC5RCQcbpX6MWbMFhjnqe2rP14ctwuvDRA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi

When I implemented profiler and coverage check to plpgsql_check I had to
write a lot of hard maintaining code related to corect finishing some
operations (counter incrementing) usually executed by stmt_end and func_end
hooks. It is based on the fmgr hook and its own statement call stack. Can
be nice if I can throw this code and use some nice buildin API.

Can we enhance dbg API with two hooks stmt_end_err func_end_err ?

These hooks can be called from exception handlers before re raising.

Or we can define new hooks like executor hooks - stmt_exec and func_exec.
In custom hooks the exception can be catched.

What do you think about this proposal?

regards

Pavel

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kyotaro Horiguchi 2023-04-25 08:29:48 Re: Allow pg_archivecleanup to remove backup history files
Previous Message Kyotaro Horiguchi 2023-04-25 07:54:57 Re: In-placre persistance change of a relation