Found a bug:
create table foo as select x, floor(random()*100)::int as y,
floor(random()*100)::int as z from generate_series(1,1000000) f(x);
explain select count(y) filter (where y<0.01) from foo where x < 10000;
ERROR: variable not found in subplan target list
STATEMENT: select count(y) filter (where y<0.01) from foo where x < 10000;
Bisects to:
commit 59a3795c2589a0e6dfe4d9a886de9423b3f8b057
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: Sun Jun 26 12:08:12 2016 -0400
Simplify planner's final setup of Aggrefs for partial aggregation.
Cheers,
Jeff