>>>>> "Tom" == Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:
>> Further experimentation reveals that this change has the effect of
>> blocking constant-folding in aggregate input expressions that refer
>> to constant outputs of the subquery. Is it worth doing anything
>> about that?
Tom> Uh ... but I thought the point here is that the outputs aren't
Tom> really constant in the presence of grouping sets.
select x, y, sum(z) from (select 1 as x, 2 as y, 3 as z) s
group by grouping sets (x,y);
x and y aren't constants, but z is.
--
Andrew (irc:RhodiumToad)