pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix setrefs.c's failure to do expression processing on prune ste
Date: Fri, 17 Jan 2025 01:40:26 +0000
Message-ID: <E1tYbLW-0020CN-3m@gemulon.postgresql.org> (raw)

Fix setrefs.c's failure to do expression processing on prune steps.

We should run the expression subtrees of PartitionedRelPruneInfo
structs through fix_scan_expr.  Failure to do so means that
AlternativeSubPlans within those expressions won't be cleaned up
properly, resulting in "unrecognized node type" errors since v14.

It seems fairly likely that at least some of the other steps done
by fix_scan_expr are important here as well, resulting in as-yet-
undetected bugs.  Therefore, I've chosen to back-patch this to
all supported branches including v13, even though the known
symptom doesn't manifest in v13.

Per bug #18778 from Alexander Lakhin.

Discussion: https://postgr.es/m/18778-24cd399df6c806af@postgresql.org

Branch
------
REL_17_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/0671a71e0210f7a3be55af240e9e7bbbea3cb44d

Modified Files
--------------
src/backend/optimizer/plan/setrefs.c          | 12 +++++++++++
src/test/regress/expected/partition_prune.out | 29 +++++++++++++++++++++++++++
src/test/regress/sql/partition_prune.sql      | 15 ++++++++++++++
3 files changed, 56 insertions(+)



view thread (6+ messages)  latest in thread

Message-ID: <E1tYbLW-0020CN-3m@gemulon.postgresql.org>
Permalink:  ../E1tYbLW-0020CN-3m@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1tYbLW-0020CN-3m@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: tgl@sss.pgh.pa.us, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Fix setrefs.c's failure to do expression processing on prune ste
  In-Reply-To: <E1tYbLW-0020CN-3m@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