Re: unnest multirange, returned order

Daniel Fredouille <daniel.fredouille@gmail.com>

From: Daniel Fredouille <daniel.fredouille@gmail.com>
To: Laurenz Albe <laurenz.albe@cybertec.at>
Cc: pgsql-docs@lists.postgresql.org
Date: 2023-10-13T19:33:57Z
Lists: pgsql-hackers, pgsql-docs
Hi,

sorry it took me some time to reply. Yes, the patch is perfect if this is
indeed the behavior.

cheers
Daniel

Le jeu. 5 oct. 2023 à 02:50, Laurenz Albe <laurenz.albe@cybertec.at> a
écrit :

> On Wed, 2023-10-04 at 20:12 -0400, Daniel Fredouille wrote:
> > unnest ( anymultirange ) → setof anyrange
> > Expands a multirange into a set of ranges. The ranges are read out in
> storage order (ascending) and therefore order cannot be relied upon.
>
> That's not true.  The order is deterministic and can be relied on.
>
> How about the attached patch, which does away with the confusing
> mention of "storage order"?
>
> Yours,
> Laurenz Albe
>

Commits

  1. Clarify the result order of unnest(multirange).