Re: Arrays are sorted when using intarray subtraction operator - Mailing list pgsql-bugs

From David G. Johnston
Subject Re: Arrays are sorted when using intarray subtraction operator
Date
Msg-id CAKFQuwaahssqGJ+USNutNdu3M4ud98Ary2fxopzzshAxUvCPtw@mail.gmail.com
Whole thread Raw
In response to Arrays are sorted when using intarray subtraction operator  (Casey & Gina <cg@osss.net>)
Responses Re: Arrays are sorted when using intarray subtraction operator
List pgsql-bugs
On Tuesday, June 4, 2024, Casey & Gina <cg@osss.net> wrote:
I've noticed that when using the `-` operator provided by the intarray extension, it appears to sort the results.  Although I want the results sorted, I'd expect to have to additionally use the `sort` function it provides, as this behavior isn't documented.  I don't want to rely on undocumented behavior, although it would simplify my queries to do so.  Is the documentation lacking in this detail, or is it an unintended bug?

I would consider it an undocumented effect as to what the resultant array with elements removed looks like.  If you need to ensure you have a sorted array use the sort function.

David J.

pgsql-bugs by date:

Previous
From: Casey & Gina
Date:
Subject: Arrays are sorted when using intarray subtraction operator
Next
From: Tom Lane
Date:
Subject: Re: Arrays are sorted when using intarray subtraction operator