Re: add function argument names to regex* functions.

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: add function argument names to regex* functions.
Дата
Msg-id CA+Tgmobj8HN8-bormKJHpONtFr2wjXbKJS0cTKzrYvVU9KSxHA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: add function argument names to regex* functions.  ("David G. Johnston" <david.g.johnston@gmail.com>)
Ответы Re: add function argument names to regex* functions.
Список pgsql-hackers
On Wed, May 15, 2024 at 4:13 PM David G. Johnston
<david.g.johnston@gmail.com> wrote:
>
> You just broke my brain when you say that you read:
>
> By default, only the first match of the pattern is replaced.  If replace_at is specified and greater than zero, then
thefirst "replace_at - 1" matches are skipped before making a single replacement (i.e., the g flag is ignored when
replace_atis specified.) 
>
> And then say:
>
> I'd expect replace_at to be a character position or something, not an occurrence count.

Ah. What I meant was: if I just saw the parameter name, and not the
documentation, I believe that I would not correctly understand what it
did. I would have had to read the docs. Whereas I'm pretty sure at
some point years ago, I looked up these functions and I saw "N", and I
did understand what that did without needing it explained. If I had
seen "count" or "occurrence" I think I would have understood that
without further explanation, too.

So my point was: to me, N is more self-documenting than replace_at,
and less self-documenting than count or occurrence.

If your mileage varies on that point, so be it!

--
Robert Haas
EDB: http://www.enterprisedb.com



В списке pgsql-hackers по дате отправления:

Предыдущее
От: "David G. Johnston"
Дата:
Сообщение: Re: add function argument names to regex* functions.
Следующее
От: Nathan Bossart
Дата:
Сообщение: Re: More performance improvements for pg_dump in binary upgrade mode