summaryrefslogtreecommitdiff
path: root/src/backend/executor
diff options
context:
space:
mode:
authorAlvaro Herrera <alvherre@alvh.no-ip.org>2018-08-16 12:43:04 -0300
committerAlvaro Herrera <alvherre@alvh.no-ip.org>2018-08-16 12:49:39 -0300
commit6589a435d83ba0b22cb56381fc5b410eb0e27834 (patch)
tree220beb7632a4f4bfacf3066e2c04889164717137 /src/backend/executor
parent43ba5ac6aa4879eea2d16f7f531b256c8203a3c3 (diff)
Fix executor prune failure when plan already pruned
In a multi-layer partitioning setup, if at plan time all the sub-partitions are pruned but the intermediate one remains, the executor later throws a spurious error that there's nothing to prune. That is correct, but there's no reason to throw an error. Therefore, don't. Reported-by: Andreas Seltenreich <seltenreich@gmx.de> Author: David Rowley <david.rowley@2ndquadrant.com> Discussion: https://postgr.es/m/87in4h98i0.fsf@ansel.ydns.eu
Diffstat (limited to 'src/backend/executor')
-rw-r--r--src/backend/executor/execPartition.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/backend/executor/execPartition.c b/src/backend/executor/execPartition.c
index e1e100114cf..225aa12c3f6 100644
--- a/src/backend/executor/execPartition.c
+++ b/src/backend/executor/execPartition.c
@@ -1887,8 +1887,13 @@ find_matching_subplans_recurse(PartitionPruningData *prunedata,
initial_prune, validsubplans);
else
{
- /* Shouldn't happen */
- elog(ERROR, "partition missing from subplans");
+ /*
+ * We get here if the planner already pruned all the sub-
+ * partitions for this partition. Silently ignore this
+ * partition in this case. The end result is the same: we
+ * would have pruned all partitions just the same, but we
+ * don't have any pruning steps to execute to verify this.
+ */
}
}
}