Re: add function argument names to regex* functions.

Jim Nasby <jim.nasby@gmail.com>

From: Jim Nasby <jim.nasby@gmail.com>
To: Dian Fay <di@nmfay.com>, jian he <jian.universality@gmail.com>, Peter Eisentraut <peter@eisentraut.org>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2024-01-03T23:25:59Z
Lists: pgsql-hackers

Attachments

<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <div class="moz-cite-prefix">On 1/3/24 5:05 PM, Dian Fay wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:CY5G4TAMVX32.23TH6LFF93ATZ@nmfay.com">
      <blockquote type="cite">
        <blockquote type="cite">
          <pre class="moz-quote-pre" wrap="">Another possibility is `index`, which is relatively short and not a
reserved keyword ^1. `position` is not as precise but would avoid the
conceptual overloading of ordinary indices.
</pre>
        </blockquote>
        <pre class="moz-quote-pre" wrap="">
I'm not a fan of "index" since that leaves the question of
whether it's 0 or 1 based. "Position" is a bit better, but I think
Jian's suggestion of "occurance" is best.
</pre>
      </blockquote>
      <pre class="moz-quote-pre" wrap="">
We do have precedent for one-based `index` in Postgres: array types are
1-indexed by default! "Occurrence" removes that ambiguity but it's long
and easy to misspell (I looked it up after typing it just now and it
_still_ feels off).

How's "instance"?
</pre>
    </blockquote>
    <p>Presumably someone referencing arguments by name would have just
      looked up the names via \df or whatever, so presumably misspelling
      wouldn't be a big issue. But I think "instance" is OK as well.<br>
    </p>
    <pre class="moz-signature" cols="72">-- 
Jim Nasby, Data Architect, Austin TX</pre>
  </body>
</html>



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.