On Wed, May 15, 2024 at 3:25 PM David G. Johnston <david.g.johns...@gmail.com> wrote: > The function replaces matches, not random characters. And if you are reading > the documentation I find it implausible that the wording I suggested would > cause one to think in terms of characters instead of matches.
I mean I just told you what my reaction to it was. If you find that reaction "implausible" then I guess you think I was lying when I said that? > N - The label provides zero context as to what the number you place there is > going to be used for. Labels ideally do more work than this especially if > someone takes the time to spell them out. Otherwise why use "pattern" > instead of "p". I feel like you're attacking a straw man here. I never said that N was my first choice; in fact, I said the opposite. But I do think that if the documentation says, as it does, that the function is regexp_replace(source, pattern, replacement, start, N, flags), a reader who has some idea what a function called regexp_replace might do will probably be able to guess what N is. It's probably also true that if we changed "pattern" to "p" they would still be able to guess that too, because there's nothing other than a pattern that you'd expect to pass to a regexp-replacement function that starts with p, but it would still be worse than what we have now. -- Robert Haas EDB: http://www.enterprisedb.com