Re: general purpose array_sort - Mailing list pgsql-hackers

From Robert Haas
Subject Re: general purpose array_sort
Date
Msg-id CA+TgmoYAmbqf7VRRrX-Dr2BGSiKASOdLyzi+bLDsM9fMtq+yHA@mail.gmail.com
Whole thread Raw
In response to Re: general purpose array_sort  (Junwang Zhao <zhjwpku@gmail.com>)
Responses Re: general purpose array_sort
List pgsql-hackers
On Thu, Nov 7, 2024 at 8:56 AM Junwang Zhao <zhjwpku@gmail.com> wrote:
> Yeah, this is reasonable but one case I can't be sure:
>
> SELECT array_sort('{{2,3,4}}'::xid[]);
>
> This will return the array as is, but xid doesn't have a LT_OPR, should
> I error out in this case? like:
>
> could not identify ordering operator for type xid[]

Yes, I think that case needs to error out. It seems best to identify
the ordering operator before you decide whether or not you have >1
element.

--
Robert Haas
EDB: http://www.enterprisedb.com



pgsql-hackers by date:

Previous
From: Peter Geoghegan
Date:
Subject: Re: Deleting older versions in unique indexes to avoid page splits
Next
From: Ilia Evdokimov
Date:
Subject: Re: Vacuum statistics