On Fri, Jul 19, 2024 at 5:48 AM Tom Lane <t...@sss.pgh.pa.us> wrote: > > jian he <jian.universal...@gmail.com> writes: > > [ v5-0001-add-regex-functions-argument-names-to-pg_proc.patch ] > > I'm not sure whether we've bikeshedded this to death yet, but > personally I'm content with the naming choices here (which basically > are those already shown in table 9.10). However, while looking > at the patch I noticed a couple of issues, one small, the other > a bit bigger. > > The small issue is that table 9.10 offers this syntax diagram > for regexp_replace: > > regexp_replace ( string text, pattern text, replacement text [, start integer > ] [, flags text ] ) → text > > This implies that it's valid to write > > regexp_replace (string, pattern, replacement, start, flags) > > but it is not: we have no function matching that signature. I'm not > in a hurry to add one, either, for fear of ambiguity against the other > regexp_replace signature. I think this needs to be broken into two > syntax diagrams: > > regexp_replace ( string text, pattern text, replacement text [, start integer > ] ) → text > regexp_replace ( string text, pattern text, replacement text [, flags text ] > ) → text
We can list them separately. regexp_replace(string, pattern, replacement [, start]) regexp_replace(string, pattern, replacement [, flags]) regexp_replace(string, pattern, replacement , start , N [, flags ]). if both optional is not there then they are the same, list 2 potential identical functions separately seems wrong? so i choose 2 bracket with a vertical bar: regexp_replace(string, pattern, replacement [[, start] | [, flags]]). maybe less readable. > The larger issue is that contrib/citext offers versions of some of > these functions that are meant to be drop-in replacements using > citext input. Hence, we need to add the same parameter names to > those functions, or they'll fail to replace some calls. > I first wanted to use alterfunction solve this, then found out it cannot, later I found out CREATE OR REPLACE FUNCTION saved us. citext module, these functions: regexp_match() regexp_matches() regexp_replace() regexp_split_to_array() regexp_split_to_table() were created in contrib/citext/citext--1.4.sql, we can add the CREATE OR REPLACE FUNCTION to 1.4.sql. but to avoid unintended consequences I just add these to the newly created file citext--1.6--1.7.sql, to make a version bump.
From 1517c6cd25885c0dd2cc4d08549204fbe004e84a Mon Sep 17 00:00:00 2001 From: jian he <jian.universal...@gmail.com> Date: Fri, 19 Jul 2024 13:37:59 +0800 Subject: [PATCH v6 1/1] add regex functions argument names Specifically add function argument names to the following funtions: regexp_replace, regexp_match, regexp_matches, regexp_count, regexp_instr, regexp_like, regexp_substr, regexp_split_to_table, regexp_split_to_array So it would be easier to understand these functions in psql via \df. now these functions can be called in different notaions. function argument name aslo added to the following functions appeared in citext module. regexp_match() regexp_matches() regexp_replace() regexp_split_to_array() regexp_split_to_table() --- contrib/citext/Makefile | 1 + contrib/citext/citext--1.6--1.7.sql | 45 ++++++++++++++++++ contrib/citext/citext.control | 2 +- contrib/citext/expected/citext_1.out | 31 ++++++++++++ contrib/citext/meson.build | 1 + contrib/citext/sql/citext.sql | 9 ++++ doc/src/sgml/func.sgml | 39 ++++++++++----- src/include/catalog/pg_proc.dat | 71 ++++++++++++++++++++++------ 8 files changed, 171 insertions(+), 28 deletions(-) create mode 100644 contrib/citext/citext--1.6--1.7.sql diff --git a/contrib/citext/Makefile b/contrib/citext/Makefile index 35db6eac..b9b3713f 100644 --- a/contrib/citext/Makefile +++ b/contrib/citext/Makefile @@ -4,6 +4,7 @@ MODULES = citext EXTENSION = citext DATA = citext--1.4.sql \ + citext--1.6--1.7.sql \ citext--1.5--1.6.sql \ citext--1.4--1.5.sql \ citext--1.3--1.4.sql \ diff --git a/contrib/citext/citext--1.6--1.7.sql b/contrib/citext/citext--1.6--1.7.sql new file mode 100644 index 00000000..07dca0d4 --- /dev/null +++ b/contrib/citext/citext--1.6--1.7.sql @@ -0,0 +1,45 @@ +/* contrib/citext/citext--1.6--1.7.sql */ + +-- complain if script is sourced in psql, rather than via ALTER EXTENSION +\echo Use "ALTER EXTENSION citext UPDATE TO '1.7'" to load this file. \quit + +-- adding function argument names +CREATE OR REPLACE FUNCTION regexp_match(string citext, pattern citext ) RETURNS TEXT[] AS $$ + SELECT pg_catalog.regexp_match($1::pg_catalog.text, $2::pg_catalog.text, 'i' ); +$$ LANGUAGE SQL IMMUTABLE STRICT PARALLEL SAFE; + +CREATE OR REPLACE FUNCTION regexp_match(string citext,pattern citext, flags text ) RETURNS TEXT[] AS $$ + SELECT pg_catalog.regexp_match( $1::pg_catalog.text, $2::pg_catalog.text, CASE WHEN pg_catalog.strpos($3, 'c') = 0 THEN $3 || 'i' ELSE $3 END ); +$$ LANGUAGE SQL IMMUTABLE STRICT PARALLEL SAFE; + +CREATE OR REPLACE FUNCTION regexp_matches(string citext, pattern citext ) RETURNS SETOF TEXT[] AS $$ + SELECT pg_catalog.regexp_matches( $1::pg_catalog.text, $2::pg_catalog.text, 'i' ); +$$ LANGUAGE SQL IMMUTABLE STRICT PARALLEL SAFE ROWS 1; + +CREATE OR REPLACE FUNCTION regexp_matches(string citext, pattern citext, flags text ) RETURNS SETOF TEXT[] AS $$ + SELECT pg_catalog.regexp_matches( $1::pg_catalog.text, $2::pg_catalog.text, CASE WHEN pg_catalog.strpos($3, 'c') = 0 THEN $3 || 'i' ELSE $3 END ); +$$ LANGUAGE SQL IMMUTABLE STRICT PARALLEL SAFE ROWS 10; + +CREATE OR REPLACE FUNCTION regexp_replace(string citext, pattern citext, replacement text ) returns TEXT AS $$ + SELECT pg_catalog.regexp_replace( $1::pg_catalog.text, $2::pg_catalog.text, $3, 'i'); +$$ LANGUAGE SQL IMMUTABLE STRICT PARALLEL SAFE; + +CREATE OR REPLACE FUNCTION regexp_replace(string citext, pattern citext, replacement text, flags text ) returns TEXT AS $$ + SELECT pg_catalog.regexp_replace( $1::pg_catalog.text, $2::pg_catalog.text, $3, CASE WHEN pg_catalog.strpos($4, 'c') = 0 THEN $4 || 'i' ELSE $4 END); +$$ LANGUAGE SQL IMMUTABLE STRICT PARALLEL SAFE; + +CREATE OR REPLACE FUNCTION regexp_split_to_array(string citext, pattern citext ) RETURNS TEXT[] AS $$ + SELECT pg_catalog.regexp_split_to_array( $1::pg_catalog.text, $2::pg_catalog.text, 'i' ); +$$ LANGUAGE SQL IMMUTABLE STRICT PARALLEL SAFE; + +CREATE OR REPLACE FUNCTION regexp_split_to_array(string citext, pattern citext, flags text ) RETURNS TEXT[] AS $$ + SELECT pg_catalog.regexp_split_to_array( $1::pg_catalog.text, $2::pg_catalog.text, CASE WHEN pg_catalog.strpos($3, 'c') = 0 THEN $3 || 'i' ELSE $3 END ); +$$ LANGUAGE SQL IMMUTABLE STRICT PARALLEL SAFE; + +CREATE OR REPLACE FUNCTION regexp_split_to_table(string citext, pattern citext ) RETURNS SETOF TEXT AS $$ + SELECT pg_catalog.regexp_split_to_table( $1::pg_catalog.text, $2::pg_catalog.text, 'i' ); +$$ LANGUAGE SQL IMMUTABLE STRICT PARALLEL SAFE; + +CREATE OR REPLACE FUNCTION regexp_split_to_table(string citext, pattern citext, flags text ) RETURNS SETOF TEXT AS $$ + SELECT pg_catalog.regexp_split_to_table( $1::pg_catalog.text, $2::pg_catalog.text, CASE WHEN pg_catalog.strpos($3, 'c') = 0 THEN $3 || 'i' ELSE $3 END ); +$$ LANGUAGE SQL IMMUTABLE STRICT PARALLEL SAFE; \ No newline at end of file diff --git a/contrib/citext/citext.control b/contrib/citext/citext.control index ccf44547..f82265b3 100644 --- a/contrib/citext/citext.control +++ b/contrib/citext/citext.control @@ -1,6 +1,6 @@ # citext extension comment = 'data type for case-insensitive character strings' -default_version = '1.6' +default_version = '1.7' module_pathname = '$libdir/citext' relocatable = true trusted = true diff --git a/contrib/citext/expected/citext_1.out b/contrib/citext/expected/citext_1.out index c5e5f180..91803bb4 100644 --- a/contrib/citext/expected/citext_1.out +++ b/contrib/citext/expected/citext_1.out @@ -1812,6 +1812,13 @@ SELECT regexp_match('foobarbequebaz'::citext, '(BAR)(BEQUE)'::citext, 'c'::citex (1 row) +SELECT regexp_match(string=>'foobarbequebaz'::citext, pattern=>'(BAR)(BEQUE)'::citext, flags=>'c'::citext) + = ARRAY[ 'bar', 'beque' ] AS "no result"; + no result +----------- + +(1 row) + -- g is not allowed SELECT regexp_match('foobarbequebazmorebarbequetoo'::citext, '(BAR)(BEQUE)'::citext, 'g') AS "error"; ERROR: regexp_match() does not support the "global" option @@ -1865,6 +1872,12 @@ SELECT regexp_matches('foobarbequebaz'::citext, '(BAR)(BEQUE)'::citext, 'c'::cit --------- (0 rows) +SELECT regexp_matches(string=>'foobarbequebaz'::citext, pattern=>'(BAR)(BEQUE)'::citext, flags=>'c'::citext) + = ARRAY[ 'bar', 'beque' ] AS "no rows"; + no rows +--------- +(0 rows) + -- g allows multiple output rows SELECT regexp_matches('foobarbequebazmorebarbequetoo'::citext, '(BAR)(BEQUE)'::citext, 'g'::citext) AS "two rows"; two rows @@ -1904,6 +1917,12 @@ SELECT regexp_replace('Thomas'::citext, '.[MN]A.'::citext, 'M', 'c') = 'Thomas' t (1 row) +SELECT regexp_replace(string=>'Thomas'::citext, pattern=>'.[MN]A.'::citext, replacement=>'M', flags=>'c') = 'Thomas' AS t; + t +--- + t +(1 row) + SELECT regexp_split_to_array('hello world'::citext, E'\\s+') = ARRAY[ 'hello', 'world' ] AS t; t --- @@ -1953,6 +1972,12 @@ SELECT regexp_split_to_array('helloTworld'::citext, 't'::citext, 'c') = ARRAY[ ' t (1 row) +SELECT regexp_split_to_array(string=>'helloTworld'::citext, pattern=>'t'::citext, flags=>'c') = ARRAY[ 'helloTworld' ] AS t; + t +--- + t +(1 row) + SELECT regexp_split_to_table('hello world'::citext, E'\\s+') AS words; words ------- @@ -1988,6 +2013,12 @@ SELECT regexp_split_to_table('helloTworld'::citext, 't'::citext, 'c') AS word; helloTworld (1 row) +SELECT regexp_split_to_table(string=>'helloTworld'::citext, pattern=>'t'::citext, flags=>'c') AS word; + word +------------- + helloTworld +(1 row) + SELECT repeat('Pg'::citext, 4) = 'PgPgPgPg' AS t; t --- diff --git a/contrib/citext/meson.build b/contrib/citext/meson.build index 9770ab3a..40cdd0d2 100644 --- a/contrib/citext/meson.build +++ b/contrib/citext/meson.build @@ -25,6 +25,7 @@ install_data( 'citext--1.4.sql', 'citext--1.4--1.5.sql', 'citext--1.5--1.6.sql', + 'citext--1.6--1.7.sql', kwargs: contrib_data_args, ) diff --git a/contrib/citext/sql/citext.sql b/contrib/citext/sql/citext.sql index aa1cf9ab..8c85f9ec 100644 --- a/contrib/citext/sql/citext.sql +++ b/contrib/citext/sql/citext.sql @@ -587,6 +587,9 @@ SELECT regexp_match('foobarbequebaz', '(BAR)(BEQUE)'::citext, '') = ARRAY[ 'bar' SELECT regexp_match('foobarbequebaz'::citext, '(BAR)(BEQUE)'::citext, ''::citext) = ARRAY[ 'bar', 'beque' ] AS t; -- c forces case-sensitive SELECT regexp_match('foobarbequebaz'::citext, '(BAR)(BEQUE)'::citext, 'c'::citext) = ARRAY[ 'bar', 'beque' ] AS "no result"; +SELECT regexp_match(string=>'foobarbequebaz'::citext, pattern=>'(BAR)(BEQUE)'::citext, flags=>'c'::citext) + = ARRAY[ 'bar', 'beque' ] AS "no result"; + -- g is not allowed SELECT regexp_match('foobarbequebazmorebarbequetoo'::citext, '(BAR)(BEQUE)'::citext, 'g') AS "error"; @@ -599,6 +602,9 @@ SELECT regexp_matches('foobarbequebaz', '(BAR)(BEQUE)'::citext, '') = ARRAY[ 'ba SELECT regexp_matches('foobarbequebaz'::citext, '(BAR)(BEQUE)'::citext, ''::citext) = ARRAY[ 'bar', 'beque' ] AS t; -- c forces case-sensitive SELECT regexp_matches('foobarbequebaz'::citext, '(BAR)(BEQUE)'::citext, 'c'::citext) = ARRAY[ 'bar', 'beque' ] AS "no rows"; +SELECT regexp_matches(string=>'foobarbequebaz'::citext, pattern=>'(BAR)(BEQUE)'::citext, flags=>'c'::citext) + = ARRAY[ 'bar', 'beque' ] AS "no rows"; + -- g allows multiple output rows SELECT regexp_matches('foobarbequebazmorebarbequetoo'::citext, '(BAR)(BEQUE)'::citext, 'g'::citext) AS "two rows"; @@ -608,6 +614,7 @@ SELECT regexp_replace('Thomas', '.[MN]A.'::citext, 'M') = 'ThM' AS t; SELECT regexp_replace('Thomas'::citext, '.[MN]A.'::citext, 'M') = 'ThM' AS t; -- c forces case-sensitive SELECT regexp_replace('Thomas'::citext, '.[MN]A.'::citext, 'M', 'c') = 'Thomas' AS t; +SELECT regexp_replace(string=>'Thomas'::citext, pattern=>'.[MN]A.'::citext, replacement=>'M', flags=>'c') = 'Thomas' AS t; SELECT regexp_split_to_array('hello world'::citext, E'\\s+') = ARRAY[ 'hello', 'world' ] AS t; SELECT regexp_split_to_array('helloTworld'::citext, 't') = ARRAY[ 'hello', 'world' ] AS t; @@ -619,6 +626,7 @@ SELECT regexp_split_to_array('helloTworld'::citext, 't'::citext, 's') = ARRAY[ ' -- c forces case-sensitive SELECT regexp_split_to_array('helloTworld'::citext, 't'::citext, 'c') = ARRAY[ 'helloTworld' ] AS t; +SELECT regexp_split_to_array(string=>'helloTworld'::citext, pattern=>'t'::citext, flags=>'c') = ARRAY[ 'helloTworld' ] AS t; SELECT regexp_split_to_table('hello world'::citext, E'\\s+') AS words; SELECT regexp_split_to_table('helloTworld'::citext, 't') AS words; @@ -626,6 +634,7 @@ SELECT regexp_split_to_table('helloTworld', 't'::citext) AS words; SELECT regexp_split_to_table('helloTworld'::citext, 't'::citext) AS words; -- c forces case-sensitive SELECT regexp_split_to_table('helloTworld'::citext, 't'::citext, 'c') AS word; +SELECT regexp_split_to_table(string=>'helloTworld'::citext, pattern=>'t'::citext, flags=>'c') AS word; SELECT repeat('Pg'::citext, 4) = 'PgPgPgPg' AS t; diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml index fd5699f4..a329cb81 100644 --- a/doc/src/sgml/func.sgml +++ b/doc/src/sgml/func.sgml @@ -3426,19 +3426,29 @@ SELECT NOT(ROW(table.*) IS NOT NULL) FROM TABLE; -- detect at least one null in <primary>regexp_replace</primary> </indexterm> <function>regexp_replace</function> ( <parameter>string</parameter> <type>text</type>, <parameter>pattern</parameter> <type>text</type>, <parameter>replacement</parameter> <type>text</type> - [, <parameter>start</parameter> <type>integer</type> ] - [, <parameter>flags</parameter> <type>text</type> ] ) + <optional> + <optional>, <parameter>start</parameter> <type>integer</type> </optional> | + <optional>, <parameter>flags</parameter> <type>text</type> </optional> + </optional>) <returnvalue>text</returnvalue> </para> <para> Replaces the substring that is the first match to the POSIX regular expression <parameter>pattern</parameter>, or all such - matches if the <literal>g</literal> flag is used; see + matches if the <literal>g</literal> flag is used. + The optional <parameter>start</parameter> is the character index that beginning to search for in <parameter>string</parameter>, + character index begin with 1. + <parameter>start</parameter> cannot specified together with <parameter>flags</parameter>. + see <xref linkend="functions-posix-regexp"/>. </para> <para> <literal>regexp_replace('Thomas', '.[mN]a.', 'M')</literal> <returnvalue>ThM</returnvalue> + </para> + <para> + <literal>regexp_replace('A PostgreSQL function', 'A|e|i|o|u', 'X', 2)</literal> + <returnvalue>A PXstgreSQL function</returnvalue> </para></entry> </row> @@ -6109,18 +6119,21 @@ SELECT col1, (SELECT regexp_matches(col2, '(bar)(beque)')) FROM tab; The <function>regexp_replace</function> function provides substitution of new text for substrings that match POSIX regular expression patterns. It has the syntax - <function>regexp_replace</function>(<replaceable>source</replaceable>, + <function>regexp_replace</function>(<replaceable>string</replaceable>, <replaceable>pattern</replaceable>, <replaceable>replacement</replaceable> - <optional>, <replaceable>start</replaceable> - <optional>, <replaceable>N</replaceable> - </optional></optional> + <optional> + <optional>, <replaceable>start</replaceable></optional> | + <optional>, <replaceable>flags</replaceable></optional> + </optional>) + and + <function>regexp_replace</function>(<replaceable>string</replaceable>, + <replaceable>pattern</replaceable>, <replaceable>replacement</replaceable> + , <replaceable>start</replaceable> + , <replaceable>N</replaceable> <optional>, <replaceable>flags</replaceable> </optional>). - (Notice that <replaceable>N</replaceable> cannot be specified - unless <replaceable>start</replaceable> is, - but <replaceable>flags</replaceable> can be given in any case.) - The <replaceable>source</replaceable> string is returned unchanged if + The <replaceable>string</replaceable> is returned unchanged if there is no match to the <replaceable>pattern</replaceable>. If there is a - match, the <replaceable>source</replaceable> string is returned with the + match, the <replaceable>string</replaceable> is returned with the <replaceable>replacement</replaceable> string substituted for the matching substring. The <replaceable>replacement</replaceable> string can contain <literal>\</literal><replaceable>n</replaceable>, where <replaceable>n</replaceable> is 1 @@ -6161,7 +6174,7 @@ regexp_replace('foobarbaz', 'b(..)', 'X\1Y', 'g') <lineannotation>fooXarYXazY</lineannotation> regexp_replace('A PostgreSQL function', 'a|e|i|o|u', 'X', 1, 0, 'i') <lineannotation>X PXstgrXSQL fXnctXXn</lineannotation> -regexp_replace('A PostgreSQL function', 'a|e|i|o|u', 'X', 1, 3, 'i') +regexp_replace(string=>'A PostgreSQL function', pattern=>'a|e|i|o|u', replacement=>'X',start=>1, "N"=>3, flags=>'i'); <lineannotation>A PostgrXSQL function</lineannotation> </programlisting> </para> diff --git a/src/include/catalog/pg_proc.dat b/src/include/catalog/pg_proc.dat index 73d9cf85..e4ead68f 100644 --- a/src/include/catalog/pg_proc.dat +++ b/src/include/catalog/pg_proc.dat @@ -3623,105 +3623,148 @@ prosrc => 'replace_text' }, { oid => '2284', descr => 'replace text using regexp', proname => 'regexp_replace', prorettype => 'text', - proargtypes => 'text text text', prosrc => 'textregexreplace_noopt' }, + proargtypes => 'text text text', + proargnames => '{string, pattern, replacement}', + prosrc => 'textregexreplace_noopt' }, { oid => '2285', descr => 'replace text using regexp', proname => 'regexp_replace', prorettype => 'text', - proargtypes => 'text text text text', prosrc => 'textregexreplace' }, + proargtypes => 'text text text text', + proargnames => '{string, pattern, replacement, flags}', + prosrc => 'textregexreplace' }, { oid => '6251', descr => 'replace text using regexp', proname => 'regexp_replace', prorettype => 'text', proargtypes => 'text text text int4 int4 text', + proargnames => '{string, pattern, replacement, start, N, flags}', prosrc => 'textregexreplace_extended' }, { oid => '6252', descr => 'replace text using regexp', proname => 'regexp_replace', prorettype => 'text', proargtypes => 'text text text int4 int4', + proargnames => '{string, pattern, replacement, start, N}', prosrc => 'textregexreplace_extended_no_flags' }, { oid => '6253', descr => 'replace text using regexp', proname => 'regexp_replace', prorettype => 'text', proargtypes => 'text text text int4', + proargnames => '{string, pattern, replacement, start}', prosrc => 'textregexreplace_extended_no_n' }, { oid => '3396', descr => 'find first match for regexp', proname => 'regexp_match', prorettype => '_text', proargtypes => 'text text', + proargnames => '{string, pattern}', prosrc => 'regexp_match_no_flags' }, { oid => '3397', descr => 'find first match for regexp', proname => 'regexp_match', prorettype => '_text', - proargtypes => 'text text text', prosrc => 'regexp_match' }, + proargtypes => 'text text text', + proargnames => '{string, pattern, flags}', + prosrc => 'regexp_match' }, { oid => '2763', descr => 'find match(es) for regexp', proname => 'regexp_matches', prorows => '1', proretset => 't', prorettype => '_text', proargtypes => 'text text', + proargnames => '{string, pattern}', prosrc => 'regexp_matches_no_flags' }, { oid => '2764', descr => 'find match(es) for regexp', proname => 'regexp_matches', prorows => '10', proretset => 't', prorettype => '_text', proargtypes => 'text text text', + proargnames => '{string, pattern, flags}', prosrc => 'regexp_matches' }, { oid => '6254', descr => 'count regexp matches', proname => 'regexp_count', prorettype => 'int4', proargtypes => 'text text', + proargnames => '{string, pattern}', prosrc => 'regexp_count_no_start' }, { oid => '6255', descr => 'count regexp matches', proname => 'regexp_count', prorettype => 'int4', - proargtypes => 'text text int4', prosrc => 'regexp_count_no_flags' }, + proargtypes => 'text text int4', + proargnames => '{string, pattern, start}', + prosrc => 'regexp_count_no_flags' }, { oid => '6256', descr => 'count regexp matches', proname => 'regexp_count', prorettype => 'int4', - proargtypes => 'text text int4 text', prosrc => 'regexp_count' }, + proargtypes => 'text text int4 text', + proargnames => '{string, pattern, start, flags}', + prosrc => 'regexp_count' }, { oid => '6257', descr => 'position of regexp match', proname => 'regexp_instr', prorettype => 'int4', proargtypes => 'text text', + proargnames => '{string, pattern}', prosrc => 'regexp_instr_no_start' }, { oid => '6258', descr => 'position of regexp match', proname => 'regexp_instr', prorettype => 'int4', - proargtypes => 'text text int4', prosrc => 'regexp_instr_no_n' }, + proargtypes => 'text text int4', + proargnames => '{string, pattern, start}', + prosrc => 'regexp_instr_no_n' }, { oid => '6259', descr => 'position of regexp match', proname => 'regexp_instr', prorettype => 'int4', - proargtypes => 'text text int4 int4', prosrc => 'regexp_instr_no_endoption' }, + proargtypes => 'text text int4 int4', + proargnames => '{string, pattern, start, N}', + prosrc => 'regexp_instr_no_endoption' }, { oid => '6260', descr => 'position of regexp match', proname => 'regexp_instr', prorettype => 'int4', proargtypes => 'text text int4 int4 int4', + proargnames => '{string, pattern, start, N, endoption}', prosrc => 'regexp_instr_no_flags' }, { oid => '6261', descr => 'position of regexp match', proname => 'regexp_instr', prorettype => 'int4', proargtypes => 'text text int4 int4 int4 text', + proargnames => '{string, pattern, start, N, endoption, flags}', prosrc => 'regexp_instr_no_subexpr' }, { oid => '6262', descr => 'position of regexp match', proname => 'regexp_instr', prorettype => 'int4', proargtypes => 'text text int4 int4 int4 text int4', + proargnames => '{string, pattern, start, N, endoption, flags, subexpr}', prosrc => 'regexp_instr' }, { oid => '6263', descr => 'test for regexp match', - proname => 'regexp_like', prorettype => 'bool', proargtypes => 'text text', + proname => 'regexp_like', prorettype => 'bool', + proargtypes => 'text text', + proargnames => '{string, pattern}', prosrc => 'regexp_like_no_flags' }, { oid => '6264', descr => 'test for regexp match', proname => 'regexp_like', prorettype => 'bool', - proargtypes => 'text text text', prosrc => 'regexp_like' }, + proargtypes => 'text text text', + proargnames => '{string, pattern,flags}', + prosrc => 'regexp_like' }, { oid => '6265', descr => 'extract substring that matches regexp', proname => 'regexp_substr', prorettype => 'text', proargtypes => 'text text', + proargnames => '{string, pattern}', prosrc => 'regexp_substr_no_start' }, { oid => '6266', descr => 'extract substring that matches regexp', proname => 'regexp_substr', prorettype => 'text', - proargtypes => 'text text int4', prosrc => 'regexp_substr_no_n' }, + proargtypes => 'text text int4', + proargnames => '{string, pattern, start}', + prosrc => 'regexp_substr_no_n' }, { oid => '6267', descr => 'extract substring that matches regexp', proname => 'regexp_substr', prorettype => 'text', - proargtypes => 'text text int4 int4', prosrc => 'regexp_substr_no_flags' }, + proargtypes => 'text text int4 int4', + proargnames => '{string, pattern, start, N}', + prosrc => 'regexp_substr_no_flags' }, { oid => '6268', descr => 'extract substring that matches regexp', proname => 'regexp_substr', prorettype => 'text', proargtypes => 'text text int4 int4 text', + proargnames => '{string, pattern, start, N, flags}', prosrc => 'regexp_substr_no_subexpr' }, { oid => '6269', descr => 'extract substring that matches regexp', proname => 'regexp_substr', prorettype => 'text', - proargtypes => 'text text int4 int4 text int4', prosrc => 'regexp_substr' }, + proargtypes => 'text text int4 int4 text int4', + proargnames => '{string, pattern, start, N, flags, subexpr}', + prosrc => 'regexp_substr' }, { oid => '2088', descr => 'split string by field_sep and return field_num', proname => 'split_part', prorettype => 'text', proargtypes => 'text text int4', prosrc => 'split_part' }, { oid => '2765', descr => 'split string by pattern', proname => 'regexp_split_to_table', prorows => '1000', proretset => 't', prorettype => 'text', proargtypes => 'text text', + proargnames => '{string, pattern}', prosrc => 'regexp_split_to_table_no_flags' }, { oid => '2766', descr => 'split string by pattern', proname => 'regexp_split_to_table', prorows => '1000', proretset => 't', prorettype => 'text', proargtypes => 'text text text', + proargnames => '{string, pattern, flags}', prosrc => 'regexp_split_to_table' }, { oid => '2767', descr => 'split string by pattern', proname => 'regexp_split_to_array', prorettype => '_text', - proargtypes => 'text text', prosrc => 'regexp_split_to_array_no_flags' }, + proargtypes => 'text text', + proargnames => '{string, pattern}', + prosrc => 'regexp_split_to_array_no_flags' }, { oid => '2768', descr => 'split string by pattern', proname => 'regexp_split_to_array', prorettype => '_text', - proargtypes => 'text text text', prosrc => 'regexp_split_to_array' }, + proargtypes => 'text text text', + proargnames => '{string, pattern, flags}', + prosrc => 'regexp_split_to_array' }, { oid => '6330', descr => 'convert int4 number to binary', proname => 'to_bin', prorettype => 'text', proargtypes => 'int4', prosrc => 'to_bin32' }, -- 2.34.1