pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Fix error code for null FOR PORTION OF target
2+ messages / 1 participants
[nested] [flat]

* pgsql: Fix error code for null FOR PORTION OF target
@ 2026-08-21 12:15 Peter Eisentraut <peter@eisentraut.org>
  0 siblings, 0 replies; 2+ messages in thread

From: Peter Eisentraut @ 2026-08-21 12:15 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/c16a1b4f2ce8e88ec40d1465c01e327ab8721524

Modified Files
--------------
src/backend/executor/nodeModifyTable.c       | 5 +++--
src/test/regress/expected/for_portion_of.out | 8 ++++----
2 files changed, 7 insertions(+), 6 deletions(-)



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

* pgsql: Fix error code for null FOR PORTION OF target
@ 2026-08-21 12:15 Peter Eisentraut <peter@eisentraut.org>
  0 siblings, 0 replies; 2+ messages in thread

From: Peter Eisentraut @ 2026-08-21 12:15 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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(-)



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


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

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-08-21 12:15 pgsql: Fix error code for null FOR PORTION OF target Peter Eisentraut <peter@eisentraut.org>
2026-08-21 12:15 pgsql: Fix error code for null FOR PORTION OF target Peter Eisentraut <peter@eisentraut.org>

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