Re: PL/pgSQL: FOUND is NULL, not false, in event trigger functions

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jeevan Chalke <jeevan(dot)chalke(at)enterprisedb(dot)com>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: PL/pgSQL: FOUND is NULL, not false, in event trigger functions
Date: 2026-10-26 19:45:25
Message-ID: 741184.1793043925@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Jeevan Chalke <jeevan(dot)chalke(at)enterprisedb(dot)com> writes:
> plpgsql_exec_function() and plpgsql_exec_trigger() both set the magic
> variable FOUND to false before running the function body, but
> plpgsql_exec_event_trigger() does not. As a result, FOUND is NULL rather
> than false at the start of a PL/pgSQL event trigger function:

Good catch.

> Since this is a behavior difference from the other function types rather
> than
> a new feature, I think it could also be back-patched, but I'd like to hear
> what others think.

Given the lack of field complaints, I'm inclined to leave it as-is
in released branches (maybe it's not too late for v19, though).
It seems unlikely that anyone has written any code that would
be affected by this change, but ...

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Daniel Gustafsson 2026-10-26 19:54:16 Re: PL/pgSQL: FOUND is NULL, not false, in event trigger functions
Previous Message Tom Lane 2026-10-26 19:21:19 Re: [PATCH] regression test: view and rule definitions must round trip