From: Amit Langote <amitlan@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix bug in cbc127917 to handle nested Append correctly
Date: Tue, 25 Feb 2025 00:27:40 +0000
Message-ID: <E1tminU-000XCX-12@gemulon.postgresql.org> (raw)
Fix bug in cbc127917 to handle nested Append correctly
A non-leaf partition with a subplan that is an Append node was
omitted from PlannedStmt.unprunableRelids because it was mistakenly
included in PlannerGlobal.prunableRelids due to the way
PartitionedRelPruneInfo.leafpart_rti_map[] is constructed. This
happened when a non-leaf partition used an unflattened Append or
MergeAppend. As a result, ExecGetRangeTableRelation() reported an
error when called from CreatePartitionPruneState() to process the
partition's own PartitionPruneInfo, since it was treated as prunable
when it should not have been.
Reported-by: Alexander Lakhin <exclusion@gmail.com> (via sqlsmith)
Diagnosed-by: Tender Wang <tndrwang@gmail.com>
Reviewed-by: Tender Wang <tndrwang@gmail.com>
Discussion: https://postgr.es/m/74839af6-aadc-4f60-ae77-ae65f94bf607@gmail.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/cbb9086c9ef64b020cb9036f50afc14644bbf734
Modified Files
--------------
src/backend/executor/execPartition.c | 13 +++++---
src/backend/partitioning/partprune.c | 9 ++++-
src/test/regress/expected/partition_prune.out | 48 +++++++++++++++++++++++++++
src/test/regress/sql/partition_prune.sql | 12 +++++++
4 files changed, 77 insertions(+), 5 deletions(-)
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 bug in cbc127917 to handle nested Append correctly
In-Reply-To: <E1tminU-000XCX-12@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