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-05T00:04:41Z
Lists: pgsql-hackers, pgsql-docs
Trying a suggestion then:
"""
unnest ( anymultirange ) → setof anyrange
Expands a multirange into a set of ranges. The ranges are read out in
storage order (ascending) and therefore cannot be relied upon.
unnest('{[1,2), [3,4)}'::int4multirange) →
[1,2)
[3,4)
"""
Daniel
Le mer. 4 oct. 2023 à 03:20, Laurenz Albe <laurenz.albe@cybertec.at> a
écrit :
> On Tue, 2023-10-03 at 20:40 -0400, Daniel Fredouille wrote:
> > > I'd say that the storag order is the order in which PostgreSQL stores
> > > multiranges internally:
> >
> > Right, I believe that you are right but then this information is not
> useful for the developer.
> > If storage order is always ascending by range order then let's make it
> clear,
> > if order cannot be counted upon as it may evolve from postgres version
> to version,
> > then let's make it clear as well. WDYT ?
>
> I personally think that it is clear as it is written now.
>
> If you have a good suggestion for an improvement, you could send it;
> perhaps someone will pick it up.
>
> Yours,
> Laurenz Albe
>
Commits
-
Clarify the result order of unnest(multirange).
- d014e6cb1886 17.0 landed