=== Applying patches on top of PostgreSQL commit ID 451c43974f8e199097d97624a4952ad0973cea61 === /etc/rc.d/jail: WARNING: Per-jail configuration via jail_* variables is obsolete. Please consider migrating to /etc/jail.conf. Fri Jan 2 12:05:21 UTC 2026 On branch cf/5881 nothing to commit, working tree clean === using 'git am' to apply patch ./v2-0001-array_random.patch === Applying: array_random Using index info to reconstruct a base tree... A doc/src/sgml/func.sgml M src/backend/catalog/system_functions.sql M src/backend/utils/adt/arrayfuncs.c M src/include/catalog/pg_proc.dat M src/test/regress/expected/arrays.out Falling back to patching base and 3-way merge... Auto-merging src/test/regress/expected/arrays.out Auto-merging src/include/catalog/pg_proc.dat Auto-merging src/backend/utils/adt/arrayfuncs.c Auto-merging src/backend/catalog/system_functions.sql CONFLICT (modify/delete): doc/src/sgml/func.sgml deleted in HEAD and modified in array_random. Version array_random of doc/src/sgml/func.sgml left in tree. error: Failed to merge in the changes. hint: Use 'git am --show-current-patch=diff' to see the failed patch Patch failed at 0001 array_random When you have resolved this problem, run "git am --continue". If you prefer to skip this patch, run "git am --skip" instead. To restore the original branch and stop patching, run "git am --abort". Unstaged changes after reset: M src/backend/catalog/system_functions.sql M src/backend/utils/adt/arrayfuncs.c M src/include/catalog/pg_proc.dat M src/test/regress/expected/arrays.out M src/test/regress/sql/arrays.sql Removing doc/src/sgml/func.sgml === using patch(1) to apply patch ./v2-0001-array_random.patch === can't find file to patch at input line 48 Perhaps you used the wrong -p or --strip option? The text leading up to this was: -------------------------- |From e170c7110604ec7f3aee69e83dcef42da447bbcc Mon Sep 17 00:00:00 2001 |From: jian he |Date: Sat, 5 Jul 2025 11:31:55 +0800 |Subject: [PATCH v2 1/1] array_random | |we can not use function signature as array_random(anyelement, anyelement, int[] |[, int[]]) because currently, we cannot resolve the conflict for array_random(1, |2::bigint). In this case, the first argument should be promoted to bigint. | |For example: |create or replace function polyf(x anyelement, y anyelement) returns anyelement as $$ |select x + 1 |$$ language sql; | |select polyf(1, 2::bigint); |ERROR: function polyf(integer, bigint) does not exist | |select polyf(1::bigint, 2); |ERROR: function polyf(bigint, integer) does not exist | |So, we define three separate functions for array_random, similar to the approach |used for the random() function. |now it looks like: |\df array_random | List of functions | Schema | Name | Result data type | Argument data types | Type |------------+--------------+------------------+-------------------------------------------------------------------------------------+------ | pg_catalog | array_random | bigint[] | min bigint, max bigint, dims integer[], lbounds integer[] DEFAULT NULL::integer[] | func | pg_catalog | array_random | integer[] | min integer, max integer, dims integer[], lbounds integer[] DEFAULT NULL::integer[] | func | pg_catalog | array_random | numeric[] | min numeric, max numeric, dims integer[], lbounds integer[] DEFAULT NULL::integer[] | func |(3 rows) | |original discussion: https://postgr.es/m/87plssezpc.fsf@163.com |discussion: https://postgr.es/m/CACJufxF8_VzCFRHRt4OHHF74QtB8tj5Z=djsy7Y31OHKG5s1-w@mail.gmail.com |--- | doc/src/sgml/func.sgml | 34 +++ | src/backend/catalog/system_functions.sql | 21 ++ | src/backend/utils/adt/arrayfuncs.c | 258 +++++++++++++++++++++++ | src/include/catalog/pg_proc.dat | 12 ++ | src/test/regress/expected/arrays.out | 85 ++++++++ | src/test/regress/sql/arrays.sql | 27 +++ | 6 files changed, 437 insertions(+) | |diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml |index 810b2b50f0d..038a6653f17 100644 |--- a/doc/src/sgml/func.sgml |+++ b/doc/src/sgml/func.sgml -------------------------- No file to patch. Skipping patch. 1 out of 1 hunk ignored patching file src/backend/catalog/system_functions.sql patching file src/backend/utils/adt/arrayfuncs.c Hunk #1 succeeded at 167 (offset 1 line). Hunk #2 succeeded at 6066 (offset 1 line). patching file src/include/catalog/pg_proc.dat patching file src/test/regress/expected/arrays.out Hunk #1 succeeded at 3003 (offset 1 line). patching file src/test/regress/sql/arrays.sql Unstaged changes after reset: M src/backend/catalog/system_functions.sql M src/backend/utils/adt/arrayfuncs.c M src/include/catalog/pg_proc.dat M src/test/regress/expected/arrays.out M src/test/regress/sql/arrays.sql === using 'git apply' to apply patch ./v2-0001-array_random.patch === error: doc/src/sgml/func.sgml: does not exist in index Applied patch to 'src/backend/catalog/system_functions.sql' cleanly. Applied patch to 'src/backend/utils/adt/arrayfuncs.c' cleanly. Applied patch to 'src/include/catalog/pg_proc.dat' cleanly. Applied patch to 'src/test/regress/expected/arrays.out' cleanly. Applied patch to 'src/test/regress/sql/arrays.sql' cleanly.