Re: unnest multirange, returned order

From: Daniel Fredouille <daniel(dot)fredouille(at)gmail(dot)com>
To: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
Cc: pgsql-docs(at)lists(dot)postgresql(dot)org
Subject: Re: unnest multirange, returned order
Date: 2023-10-05 00:12:19
Message-ID: CAEpV6kWcAVFvmtw9amVubL7F9LWX==nE5N96uFrGm4XX6aFdVQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs pgsql-hackers

Sorry correcting my own suggestion:

"""

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.

unnest('{[1,2), [3,4)}'::int4multirange) →

[1,2)
[3,4)

"""

Le mer. 4 oct. 2023 à 20:04, Daniel Fredouille <daniel(dot)fredouille(at)gmail(dot)com>
a écrit :

> 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(dot)albe(at)cybertec(dot)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
>>
>

In response to

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message Erik Wienhold 2023-10-05 01:35:27 Re: Unclear guarantees about sort order on https://www.postgresql.org/docs/current/queries-order.html
Previous Message Daniel Fredouille 2023-10-05 00:04:41 Re: unnest multirange, returned order

Browse pgsql-hackers by date

  From Date Subject
Next Message Isaac Morland 2023-10-05 01:02:21 Re: Pre-proposal: unicode normalized text
Previous Message Daniel Fredouille 2023-10-05 00:04:41 Re: unnest multirange, returned order