From: Peter Eisentraut <peter@eisentraut.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix error code for null FOR PORTION OF target
Date: Fri, 21 Aug 2026 12:15:47 +0000
Message-ID: <E1wxO9y-00000001VtN-1MNh@gemulon.postgresql.org> (raw)
Fix error code for null FOR PORTION OF target
When the target expression of FOR PORTION OF (...) evaluated to NULL,
ExecInitModifyTable raised an error without an errcode, so clients got
the internal error code XX000 for a user-reachable condition.
Oversight in commit 8e72d914c52.
To fix, report ERRCODE_NULL_VALUE_NOT_ALLOWED, and reword the message
to "FOR PORTION OF target must not be null", matching similar executor
messages such as "frame starting offset must not be null".
Bug: #19630
Reported-by: Zheng Wang <hackerzheng666@gmail.com>
Reported-by: Yanjie Zhao
Reported-by: Yiyang Liu
Author: Zsolt Parragi <zsolt.parragi@percona.com>
Discussion: https://www.postgresql.org/message-id/flat/19630-9f10ca28426295fa%40postgresql.org
Branch
------
REL_19_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/c7e34c31e844b2234fa57fef12ae37f30c8f5a9b
Modified Files
--------------
src/backend/executor/nodeModifyTable.c | 5 +++--
src/test/regress/expected/for_portion_of.out | 8 ++++----
2 files changed, 7 insertions(+), 6 deletions(-)
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 using the --to and --cc options:
reply via email
To: pgsql-committers@postgresql.org
Cc: peter@eisentraut.org, pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Fix error code for null FOR PORTION OF target
In-Reply-To: <E1wxO9y-00000001VtN-1MNh@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