Re: unnest multirange, returned order

2023-10-04 Thread Laurenz Albe
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 asce

Unclear guarantees about sort order on https://www.postgresql.org/docs/current/queries-order.html

2023-10-04 Thread PG Doc comments form
The following documentation comment has been logged on the website: Page: https://www.postgresql.org/docs/16/queries-order.html Description: The document only says this about unsorted queries: > After a query has produced an output table (after the select list has been processed) it can optional

Missing closing ]

2023-10-04 Thread PG Doc comments form
The following documentation comment has been logged on the website: Page: https://www.postgresql.org/docs/16/rangetypes.html Description: In the example session at https://www.postgresql.org/docs/current/rangetypes.html#RANGETYPES-EXAMPLES there are missing closing square bracket ] Take a look

Re: Missing closing ]

2023-10-04 Thread Tom Lane
PG Doc comments form writes: > In the example session at > https://www.postgresql.org/docs/current/rangetypes.html#RANGETYPES-EXAMPLES > there are missing closing square bracket ] > Take a look below > CREATE TABLE reservation (room int, during tsrange); > INSERT INTO reservation VALUES > (1

Re: unnest multirange, returned order

2023-10-04 Thread Daniel Fredouille
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

Re: unnest multirange, returned order

2023-10-04 Thread Daniel Fredouille
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

Re: Unclear guarantees about sort order on https://www.postgresql.org/docs/current/queries-order.html

2023-10-04 Thread Erik Wienhold
On 2023-10-04 16:24 +0200, PG Doc comments form write: > The following documentation comment has been logged on the website: > > Page: https://www.postgresql.org/docs/16/queries-order.html > Description: > > The document only says this about unsorted queries: > > > After a query has produced an

Re: unnest multirange, returned order

2023-10-04 Thread Laurenz Albe
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 c