On Mon, Jul 1, 2019 at 3:38 PM Jeff Davis <pg...@j-davis.com> wrote: > > The patch is implicitly introducing the concept of > a "multirange" (in this case, an array of ranges),
I meant to say before: this patch always returns a sorted array, and I think a multirange should always act as if sorted when we stringify it or cast it to an array. If you disagree let me know. :-) You could imagine that when returning arrays we rely on the caller to do the sorting (range_agg(r ORDER BY r)) and otherwise give wrong results. But hopefully everyone agrees that would not be nice. :-) So even the array-returning version should always return a sorted array I think. (I'm not sure anything else is really coherent or at least easy to describe.) Paul