pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Amit Langote <amitlan@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix an oversight in cbc127917 to handle MERGE correctly
Date: Mon, 17 Feb 2025 07:13:12 +0000
Message-ID: <E1tjvJX-007Z9J-RU@gemulon.postgresql.org> (raw)

Fix an oversight in cbc127917 to handle MERGE correctly

ExecInitModifyTable() forgot to trim MERGE-related lists to exclude
entries for result relations pruned during initial pruning, so fix
that.

While at it, make the function's use of the pruned resultRelations
list, rather than ModifyTable.resultRelations, more consistent.

Reported-by: Alexander Lakhin <exclusion@gmail.com> (via sqlsmith)
Reviewed-by: Junwang Zhao <zhjwpku@gmail.com>
Discussion: https://postgr.es/m/e72c94d9-e5f9-4753-9bc1-69d72bd54b8a@gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/75dfde13639a57513e23e58c961a69c5bbf017b6

Modified Files
--------------
src/backend/executor/nodeModifyTable.c        | 35 +++++++++---
src/include/nodes/execnodes.h                 |  7 ++-
src/test/regress/expected/partition_prune.out | 77 +++++++++++++++++++++++++++
src/test/regress/sql/partition_prune.sql      | 25 +++++++++
4 files changed, 134 insertions(+), 10 deletions(-)



Message-ID: <E1tjvJX-007Z9J-RU@gemulon.postgresql.org>
Permalink:  ../E1tjvJX-007Z9J-RU@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1tjvJX-007Z9J-RU@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: amitlan@postgresql.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Fix an oversight in cbc127917 to handle MERGE correctly
  In-Reply-To: <E1tjvJX-007Z9J-RU@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