Re: add function argument names to regex* functions.

From: jian he <jian(dot)universality(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Peter Eisentraut <peter(at)eisentraut(dot)org>, Dian Fay <di(at)nmfay(dot)com>, Jim Nasby <jim(dot)nasby(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Chapman Flack <jcflack(at)acm(dot)org>
Subject: Re: add function argument names to regex* functions.
Date: 2024-07-27 00:56:00
Message-ID: CACJufxF8jVbosHsX3vXCvxyWdeNER72c+FNbCYJDjzLBqEh-xw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Jul 26, 2024 at 10:40 PM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>
> jian he <jian(dot)universality(at)gmail(dot)com> writes:
> > On Fri, Jul 26, 2024 at 10:17 PM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> >> 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.)
>
> > regexp_replace(string, pattern, replacement [, start [, N ]] [, flags ]).
>
> > can represent
>
> > regexp_replace(string, pattern, replacement , start, flags ) ?
>
> Hmm, yeah, you're right. I didn't want to write two separate
> synopses there, but maybe there's no choice.
>

we can get rid of:
(Notice that <replaceable>N</replaceable> cannot be specified
unless <replaceable>start</replaceable> is,
but <replaceable>flags</replaceable> can be given in any case.)

Now the output is
It has the syntax regexp_replace(string, pattern, replacement [, flags
]) and regexp_replace(string, pattern, replacement, start [, N [,
flags ]]).

I also decorated "[]" with "<optional>".

Attachment Content-Type Size
v1-0001-refactor-regexp_replace-syntax.patch text/x-patch 3.3 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Alexander Korotkov 2024-07-27 03:00:47 Re: pg_upgrade failing for 200+ million Large Objects
Previous Message Erik Wienhold 2024-07-27 00:45:15 Re: CREATE OR REPLACE MATERIALIZED VIEW