Re: general purpose array_sort

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Junwang Zhao <zhjwpku(at)gmail(dot)com>
Cc: Michael Paquier <michael(at)paquier(dot)xyz>, Aleksander Alekseev <aleksander(at)timescale(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, jian he <jian(dot)universality(at)gmail(dot)com>, Amit Langote <amitlangote09(at)gmail(dot)com>, "andreas(at)proxel(dot)se" <andreas(at)proxel(dot)se>
Subject: Re: general purpose array_sort
Date: 2024-11-07 14:29:05
Message-ID: CA+TgmoYAmbqf7VRRrX-Dr2BGSiKASOdLyzi+bLDsM9fMtq+yHA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Nov 7, 2024 at 8:56 AM Junwang Zhao <zhjwpku(at)gmail(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Ilia Evdokimov 2024-11-07 14:49:23 Re: Vacuum statistics
Previous Message Junwang Zhao 2024-11-07 14:26:35 Re: general purpose array_sort