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:
@ -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.
|
||||
*/
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user