From: Noah Misch <noah@leadboat.com>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Close portals at end of trigger functions with transition tables
Date: Mon, 09 Nov 2026 14:21:51 +0000
Message-ID: <E1xQQFr-000000003Mr-0wlN@gemulon.postgresql.org> (raw)
Close portals at end of trigger functions with transition tables.
The query environment needed for portals over transition tables for
triggers lasts only as long as the SPI connection, so the portals must
be closed. If not closed within the function, SPI_finish()
force-closes them.
Reported-by: Peter Geoghegan <pg@bowt.ie>
Reviewed-by: Amit Langote <amitlangote09@gmail.com>
Backpatch-through: 14
Security: CVE-2026-120143
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/7a910b4e1586fa3b198fb6e5806c7ea842012179
Author: Jeff Davis <jdavis@postgresql.org>
Modified Files
--------------
doc/src/sgml/spi.sgml | 9 +++++++++
src/backend/executor/spi.c | 14 ++++++++++++++
src/backend/utils/mmgr/portalmem.c | 34 ++++++++++++++++++++++++++++++++++
src/include/utils/portal.h | 1 +
4 files changed, 58 insertions(+)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: noah@leadboat.com
Subject: Re: pgsql: Close portals at end of trigger functions with transition tables
In-Reply-To: <E1xQQFr-000000003Mr-0wlN@gemulon.postgresql.org>
References: <E1xQQFr-000000003Mr-0wlN@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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