>>>>> "Tom" == Tom Lane <tgl@sss.pgh.pa.us> writes:
Tom> I'm not sure if it's worth trying to distinguish whether the ParamTom> is inside any aggregate calls or not. The
existingcode gets theTom> right answer for
Tom> select array(select x+sum(y) from generate_series(1,3) y group by y) Tom> from generate_series(1,3) x;
Tom> and we'd be losing some efficiency for cases like that if we fixTom> it as above. But is it worth the trouble?
The loss of efficiency could be significant, since it's forcing a rescan
of what could be an expensive plan.
--
Andrew (irc:RhodiumToad)