Pavan> I am attaching a patch that throws a similar ERROR during Pavan> planning even for 9.5. AFAICS in presence of grouping sets, we Pavan> always decide to use sort-based implementation for grouping, but Pavan> do not check if the columns support ordering or not.
Hmmm. This is obviously my fault somewhere... the patch looks good, I'll deal with it shortly.
JFR this got fixed via 7be3678a8cfb55dcfca90fa586485f835ab912a5