pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Initialize FOUND to false in PL/pgSQL event trigger functions.
2+ messages / 1 participants
[nested] [flat]

* pgsql: Initialize FOUND to false in PL/pgSQL event trigger functions.
@ 2026-10-26 21:15 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2026-10-26 21:15 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Initialize FOUND to false in PL/pgSQL event trigger functions.

The documentation says that FOUND starts out false within each
PL/pgSQL function call.  plpgsql_exec_function() and
plpgsql_exec_trigger() do set it so, but plpgsql_exec_event_trigger()
did not, leaving it NULL until the first statement that sets it.

Fix this by initializing FOUND to false, as the other two entry points
do.  While at it, also set estate.err_text to "during function entry"
during this action and the subsequent instrumentation plugin call,
again to match the other two routines.

Back-patch to v19, but no further.  It seems unlikely that any user
code is depending on the current behavior, but just in case, let's
not touch the stable branches.

Author: Jeevan Chalke <jeevan.chalke@enterprisedb.com>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/CAM2+6=U_=hZmgs1v1JJ-XJk2bpbfqQPP9MNRDbp5RoEsOW8xsQ@mail.gmail.com
Backpatch-through: 19

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/1dc45adefa076e9377718ee9529b375a70108734

Modified Files
--------------
src/pl/plpgsql/src/pl_exec.c | 7 +++++++
1 file changed, 7 insertions(+)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* pgsql: Initialize FOUND to false in PL/pgSQL event trigger functions.
@ 2026-10-26 21:15 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2026-10-26 21:15 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Initialize FOUND to false in PL/pgSQL event trigger functions.

The documentation says that FOUND starts out false within each
PL/pgSQL function call.  plpgsql_exec_function() and
plpgsql_exec_trigger() do set it so, but plpgsql_exec_event_trigger()
did not, leaving it NULL until the first statement that sets it.

Fix this by initializing FOUND to false, as the other two entry points
do.  While at it, also set estate.err_text to "during function entry"
during this action and the subsequent instrumentation plugin call,
again to match the other two routines.

Back-patch to v19, but no further.  It seems unlikely that any user
code is depending on the current behavior, but just in case, let's
not touch the stable branches.

Author: Jeevan Chalke <jeevan.chalke@enterprisedb.com>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/CAM2+6=U_=hZmgs1v1JJ-XJk2bpbfqQPP9MNRDbp5RoEsOW8xsQ@mail.gmail.com
Backpatch-through: 19

Branch
------
REL_19_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/56d9ecf6bd882a16afbeae7b8f740f9febcf420c

Modified Files
--------------
src/pl/plpgsql/src/pl_exec.c | 7 +++++++
1 file changed, 7 insertions(+)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2026-10-26 21:15 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-10-26 21:15 pgsql: Initialize FOUND to false in PL/pgSQL event trigger functions. Tom Lane <tgl@sss.pgh.pa.us>
2026-10-26 21:15 pgsql: Initialize FOUND to false in PL/pgSQL event trigger functions. Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox