Jeff Davis <pgsql@j-davis.com> writes:
> => select max(a), generate_series(1,2) as g from foo order by g desc;
> ERROR: set-valued function called in context that cannot accept a set
This strikes me as a pretty useless query, so the fact that it doesn't
work doesn't bother me. It's mostly accidental that there are any
variants that do work, I think. Why would you want a SRF in a sort key?
regards, tom lane