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.
Thanks. It might be a good idea to include that test case from the master. Please let me know if you would like me to send a new patch which includes that.