pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: David Rowley <drowley@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix possible incorrect column reference in ERROR message
Date: Thu, 08 Jan 2026 22:04:04 +0000
Message-ID: <E1vdy6t-005NT1-2R@gemulon.postgresql.org> (raw)

Fix possible incorrect column reference in ERROR message

When creating a partition for a RANGE partitioned table, the reporting
of errors relating to converting the specified range values into
constant values for the partition key's type could display the name of a
previous partition key column when an earlier range was specified as
MINVALUE or MAXVALUE.

This was caused by the code not correctly incrementing the index that
tracks which partition key the foreach loop was working on after
processing MINVALUE/MAXVALUE ranges.

Fix by using foreach_current_index() to ensure the index variable is
always set to the List element being worked on.

Author: myzhen <zhenmingyang@yeah.net>
Reviewed-by: zhibin wang <killerwzb@gmail.com>
Discussion: https://postgr.es/m/273cab52.978.19b96fc75e7.Coremail.zhenmingyang@yeah.net
Backpatch-through: 14

Branch
------
REL_16_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/821c4d27bca243a233d9e9fb26c9adad47fa85b5

Modified Files
--------------
src/backend/parser/parse_utilcmd.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)



view thread (6+ messages)  latest in thread

Message-ID: <E1vdy6t-005NT1-2R@gemulon.postgresql.org>
Permalink:  ../E1vdy6t-005NT1-2R@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1vdy6t-005NT1-2R@gemulon.postgresql.org

 · 

reply

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: drowley@postgresql.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Fix possible incorrect column reference in ERROR message
  In-Reply-To: <E1vdy6t-005NT1-2R@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