1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-03 20:02:46 +03:00

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
This commit is contained in:
Alvaro Herrera
2018-08-16 12:43:04 -03:00
parent fa73b377ee
commit 1eb9221585
3 changed files with 37 additions and 2 deletions

View File

@ -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.
*/
}
}
}