pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Robert Haas <rhaas@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix failure of setrefs.c to process child_append_relid_sets
Date: Thu, 08 Oct 2026 16:24:49 +0000
Message-ID: <E1xEqvJ-00000000pk5-1v9Y@gemulon.postgresql.org> (raw)

Fix failure of setrefs.c to process child_append_relid_sets

Commit 7358abcc6076f4b2530d10126ab379f8aea612a5 taught the planner to
store information about Append node consolidation in the final plan,
but it forgot that child_append_relid_sets needs to be adjusted
at setrefs.c time just like every other place where we store RTIs
in a plan tree. Fix that.

Although this can cause incorrect plan advice to be emitted in cases
involving multi-level partitioning, it seems more appropriate to put
the test case for it in pg_overexplain, so this commit does that.

Backpatch-through: 19
Discussion: http://postgr.es/m/CA+TgmoYYHC4i-Gpzc9-JYHqih6pOK+6LTYFiNR-PioXG1nKkOQ@mail.gmail.com

Branch
------
REL_19_STABLE

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

Modified Files
--------------
contrib/pg_overexplain/expected/pg_overexplain.out | 75 ++++++++++++++++++++++
contrib/pg_overexplain/sql/pg_overexplain.sql      | 23 +++++++
src/backend/optimizer/plan/setrefs.c               | 23 +++++++
3 files changed, 121 insertions(+)



view thread (2+ messages)

Message-ID: <E1xEqvJ-00000000pk5-1v9Y@gemulon.postgresql.org>
Permalink:  ../E1xEqvJ-00000000pk5-1v9Y@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1xEqvJ-00000000pk5-1v9Y@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 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: rhaas@postgresql.org
  Subject: Re: pgsql: Fix failure of setrefs.c to process child_append_relid_sets
  In-Reply-To: <E1xEqvJ-00000000pk5-1v9Y@gemulon.postgresql.org>
  References: <E1xEqvJ-00000000pk5-1v9Y@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