Re: add function argument names to regex* functions. - Mailing list pgsql-hackers

From Tom Lane
Subject Re: add function argument names to regex* functions.
Date
Msg-id 3999490.1721339304@sss.pgh.pa.us
Whole thread Raw
In response to Re: add function argument names to regex* functions.  (jian he <jian.universality@gmail.com>)
Responses Re: add function argument names to regex* functions.
Re: add function argument names to regex* functions.
List pgsql-hackers
jian he <jian.universality@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

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.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Tomas Vondra
Date:
Subject: Re: Showing applied extended statistics in explain Part 2
Next
From: Tomas Vondra
Date:
Subject: Re: change regexp_substr first argument make tests more easier to understand.