aboutsummaryrefslogtreecommitdiff
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:53:43 -0300
commit1eb9221585c25cad1a563bc3414f697dae3fbc8b (patch)
treea50d44ced642627e8c8c936c254d88acab732157 /src/backend/executor
parentfa73b377ee11ced0c051fb42c29a87b5c71b79e3 (diff)
downloadpostgresql-1eb9221585c25cad1a563bc3414f697dae3fbc8b.tar.gz
postgresql-1eb9221585c25cad1a563bc3414f697dae3fbc8b.zip
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 d13be4145f8..1a9943c3aac 100644
--- a/src/backend/executor/execPartition.c
+++ b/src/backend/executor/execPartition.c
@@ -1886,8 +1886,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.
+ */
}
}
}