Improve run-time partition pruning to handle any stable expression.

Tom Lane <tgl@sss.pgh.pa.us>

Commit: 73b7f48f78d27b1baf1a6541cbaae0fe6bd6186d
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: 2018-06-10T19:22:32Z
Releases: 11.0
Improve run-time partition pruning to handle any stable expression.

The initial coding of the run-time-pruning feature only coped with cases
where the partition key(s) are compared to Params.  That is a bit silly;
we can allow it to work with any non-Var-containing stable expression, as
long as we take special care with expressions containing PARAM_EXEC Params.
The code is hardly any longer this way, and it's considerably clearer
(IMO at least).  Per gripe from Pavel Stehule.

David Rowley, whacked around a bit by me

Discussion: https://postgr.es/m/CAFj8pRBjrufA3ocDm8o4LPGNye9Y+pm1b9kCwode4X04CULG3g@mail.gmail.com

Files

Discussion