From 0395bf1159c682c428716c801790b389f073cce5 Mon Sep 17 00:00:00 2001 From: jian he Date: Tue, 14 Oct 2025 15:16:04 +0800 Subject: [PATCH v8 1/2] add function argument name to function substr with patch applied \df substr List of functions Schema | Name | Result data type | Argument data types | Type ------------+--------+------------------+--------------------------------------------+------ pg_catalog | substr | bytea | source bytea, start integer | func pg_catalog | substr | bytea | source bytea, start integer, count integer | func pg_catalog | substr | text | source text, start integer | func pg_catalog | substr | text | source text, start integer, count integer | func (4 rows) discussion: https://postgr.es/m/CACJufxHTBkymh06D4mGKNe1YfRNFN+gFBybmygWk=PtMqu00LQ@mail.gmail.com --- doc/src/sgml/func/func-binarystring.sgml | 4 ++-- doc/src/sgml/func/func-string.sgml | 4 ++-- src/include/catalog/pg_proc.dat | 4 ++++ 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/doc/src/sgml/func/func-binarystring.sgml b/doc/src/sgml/func/func-binarystring.sgml index dd7037811af..294d1d97233 100644 --- a/doc/src/sgml/func/func-binarystring.sgml +++ b/doc/src/sgml/func/func-binarystring.sgml @@ -571,11 +571,11 @@ substr - substr ( bytes bytea, start integer , count integer ) + substr ( source bytea, start integer , count integer ) bytea - Extracts the substring of bytes starting at + Extracts the substring of source starting at the start'th byte, and extending for count bytes if that is specified. (Same diff --git a/doc/src/sgml/func/func-string.sgml b/doc/src/sgml/func/func-string.sgml index 01cc94c234e..f7d03eda2bc 100644 --- a/doc/src/sgml/func/func-string.sgml +++ b/doc/src/sgml/func/func-string.sgml @@ -1390,11 +1390,11 @@ substr - substr ( string text, start integer , count integer ) + substr ( source text, start integer , count integer ) text - Extracts the substring of string starting at + Extracts the substring of source starting at the start'th character, and extending for count characters if that is specified. (Same diff --git a/src/include/catalog/pg_proc.dat b/src/include/catalog/pg_proc.dat index b51d2b17379..1cbb94f22ea 100644 --- a/src/include/catalog/pg_proc.dat +++ b/src/include/catalog/pg_proc.dat @@ -3718,6 +3718,7 @@ prosrc => 'rtrim' }, { oid => '877', descr => 'extract portion of string', proname => 'substr', prorettype => 'text', proargtypes => 'text int4 int4', + proargnames => '{source, start, count}', prosrc => 'text_substr' }, { oid => '878', descr => 'map a set of characters appearing in string', proname => 'translate', prorettype => 'text', proargtypes => 'text text text', @@ -3736,6 +3737,7 @@ prosrc => 'rtrim1' }, { oid => '883', descr => 'extract portion of string', proname => 'substr', prorettype => 'text', proargtypes => 'text int4', + proargnames => '{source, start}', prosrc => 'text_substr_no_len' }, { oid => '884', descr => 'trim selected characters from both ends of string', proname => 'btrim', prorettype => 'text', proargtypes => 'text text', @@ -6306,9 +6308,11 @@ prosrc => 'bytea_substr_no_len' }, { oid => '2085', descr => 'extract portion of string', proname => 'substr', prorettype => 'bytea', proargtypes => 'bytea int4 int4', + proargnames => '{source, start, count}', prosrc => 'bytea_substr' }, { oid => '2086', descr => 'extract portion of string', proname => 'substr', prorettype => 'bytea', proargtypes => 'bytea int4', + proargnames => '{source, start}', prosrc => 'bytea_substr_no_len' }, { oid => '2014', descr => 'position of substring', proname => 'position', prorettype => 'int4', proargtypes => 'bytea bytea', -- 2.34.1