public inbox for [email protected]  
help / color / mirror / Atom feed
From: Tom Lane <[email protected]>
To: [email protected]
Subject: pgsql: Introduce a SQL-callable function array_sort(anyarray).
Date: Tue, 01 Apr 2025 22:04:31 +0000
Message-ID: <[email protected]> (raw)

Introduce a SQL-callable function array_sort(anyarray).

Create a function that will sort the elements of an array
according to the element type's sort order.  If the array
has more than one dimension, the sub-arrays of the first
dimension are sorted per normal array-comparison rules,
leaving their contents alone.

In support of this, add pg_type.typarray to the set of fields
cached by the typcache.

Author: Junwang Zhao <[email protected]>
Co-authored-by: Jian He <[email protected]>
Reviewed-by: Aleksander Alekseev <[email protected]>
Discussion: https://postgr.es/m/CAEG8a3J41a4dpw_-F94fF-JPRXYxw-GfsgoGotKcjs9LVfEEvw@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/6c12ae09f5a5d6c153eaea7901542591dc28fb9e

Modified Files
--------------
doc/src/sgml/func.sgml                         |  36 +++++
src/backend/utils/adt/array_userfuncs.c        | 178 +++++++++++++++++++++++++
src/backend/utils/cache/typcache.c             |   2 +
src/include/catalog/catversion.h               |   2 +-
src/include/catalog/pg_proc.dat                |  12 ++
src/include/utils/typcache.h                   |   1 +
src/test/regress/expected/arrays.out           | 142 ++++++++++++++++++++
src/test/regress/expected/collate.icu.utf8.out |  13 ++
src/test/regress/sql/arrays.sql                |  36 +++++
src/test/regress/sql/collate.icu.utf8.sql      |   4 +
src/tools/pgindent/typedefs.list               |   1 +
11 files changed, 426 insertions(+), 1 deletion(-)



reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: pgsql: Introduce a SQL-callable function array_sort(anyarray).
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox