Re: add function argument names to regex* functions.

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: jian he <jian.universality@gmail.com>
Cc: Robert Haas <robertmhaas@gmail.com>, Peter Eisentraut <peter@eisentraut.org>, Dian Fay <di@nmfay.com>, Jim Nasby <jim.nasby@gmail.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>, Chapman Flack <jcflack@acm.org>
Date: 2024-07-26T14:17:31Z
Lists: pgsql-hackers
jian he <jian.universality@gmail.com> writes:
> On Fri, Jul 19, 2024 at 5:48 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> 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:

> this problem is still there, after commit
> 580f8727ca93b7b9a2ce49746b9cdbcb0a2b4a7e.

No, I believe I fixed it: the table now offers

regexp_replace ( string text, pattern text, replacement text [, flags text ] ) → text

regexp_replace ( string text, pattern text, replacement text, start integer [, N integer [, flags text ] ] ) → text

That's different from either of the solutions discussed in this
thread, but simpler.

> <<
> It has the syntax regexp_replace(string, pattern, replacement [, start
> [, N ]] [, flags ]). (Notice that N cannot be specified unless start
> is, but flags can be given in any case.)
> <<
> doc, the above part still needs change?

AFAICS, that one is correct, so I left it alone.  (I didn't try to
merge the table's two entries into one like that, though.)

			regards, tom lane



Commits

  1. Doc: fix text's description of regexp_replace's arguments.

  2. Add argument names to the regexp_XXX functions.

  3. Add assorted new regexp_xxx SQL functions.