pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Add SQL function array_reverse()
Date: Fri, 01 Nov 2024 01:32:34 +0000
Message-ID: <E1t6gWg-003MzX-Ky@gemulon.postgresql.org> (raw)

Add SQL function array_reverse()

This function takes in input an array, and reverses the position of all
its elements.  This operation only affects the first dimension of the
array, like array_shuffle().

The implementation structure is inspired by array_shuffle(), with a
subroutine called array_reverse_n() that may come in handy in the
future, should more functions able to reverse portions of arrays be
introduced.

Bump catalog version.

Author: Aleksander Alekseev
Reviewed-by: Ashutosh Bapat, Tom Lane, Vladlen Popolitov
Discussion: https://postgr.es/m/CAJ7c6TMpeO_ke+QGOaAx9xdJuxa7r=49-anMh3G5476e3CX1CA@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/49d6c7d8dabad8c59ba21afe72ff32e79f822291

Modified Files
--------------
doc/src/sgml/func.sgml                  |  17 +++++
src/backend/utils/adt/array_userfuncs.c | 112 ++++++++++++++++++++++++++++++++
src/include/catalog/catversion.h        |   2 +-
src/include/catalog/pg_proc.dat         |   3 +
src/test/regress/expected/arrays.out    |  31 +++++++++
src/test/regress/sql/arrays.sql         |   7 ++
6 files changed, 171 insertions(+), 1 deletion(-)



Message-ID: <E1t6gWg-003MzX-Ky@gemulon.postgresql.org>
Permalink:  ../E1t6gWg-003MzX-Ky@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1t6gWg-003MzX-Ky@gemulon.postgresql.org

 · 

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: pgsql-committers@postgresql.org
  Cc: michael@paquier.xyz, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Add SQL function array_reverse()
  In-Reply-To: <E1t6gWg-003MzX-Ky@gemulon.postgresql.org>

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

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