Re: general purpose array_sort - Mailing list pgsql-hackers

From Dean Rasheed
Subject Re: general purpose array_sort
Date
Msg-id CAEZATCUOALcLt3ZE+5KoVM4E9H4gk3r4j00bXMQhsFjDZJZ0MQ@mail.gmail.com
Whole thread Raw
In response to Re: general purpose array_sort  (Junwang Zhao <zhjwpku@gmail.com>)
List pgsql-hackers
On Sun, 3 Nov 2024 at 03:33, Junwang Zhao <zhjwpku@gmail.com> wrote:
>
> PFA v11.
>

Testing this with an array with non-default lower bounds, it fails to
preserve the array bounds, which I think it should (note:
array_reverse() and array_shuffle() do preserve the bounds):

SELECT array_reverse(a), array_shuffle(a), array_sort(a)
  FROM (VALUES ('[10:12][20:21]={{1,2},{10,20},{3,4}}'::int[])) v(a);

-[ RECORD 1 ]-+-------------------------------------
array_reverse | [10:12][20:21]={{3,4},{10,20},{1,2}}
array_shuffle | [10:12][20:21]={{10,20},{3,4},{1,2}}
array_sort    | [1:3][20:21]={{1,2},{3,4},{10,20}}

Regards,
Dean



pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: Allowing pg_recvlogical to create temporary replication slots
Next
From: Heikki Linnakangas
Date:
Subject: Re: PG_TEST_EXTRA and meson