Re: BUG #19341: REPLACE() fails to match final character when using nondeterministic ICU collation

Laurenz Albe <laurenz.albe@cybertec.at>

From: Laurenz Albe <laurenz.albe@cybertec.at>
To: Heikki Linnakangas <hlinnaka@iki.fi>, adam.warland@infor.com, pgsql-bugs@lists.postgresql.org
Date: 2025-12-02T17:45:47Z
Lists: pgsql-bugs
On Tue, 2025-12-02 at 19:29 +0200, Heikki Linnakangas wrote:
> I added a simple test for this, and I think this is still not quite 
> right. I added the following to collate.icu.utf test:
> 
> +-- Test for match at the end of the string.  (We had a bug on that
> +-- once)
> +SELECT a, b, replace(b COLLATE ignore_accents, 'te', 'ma') FROM test4nfd;
> + a |  b   | replace
> +---+------+---------
> + 1 | cote | coma
> + 2 | côte | coma
> + 3 | coté | coma
> + 4 | côté | coma
> +(4 rows)
> +
> 
> In the added test query, the accents on the 'o' are stripped, which 
> doesn't look correct.

I am not sure if that is OK or not (after all, it's an accent
insensitive collation, so "coma" and "côma" should be the same).

But it seems unrelated to the bug report at hand.

Yours,
Laurenz Albe