Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vQURl-008vCo-1W for pgsql-bugs@arkaria.postgresql.org; Tue, 02 Dec 2025 17:45:53 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vQURk-009HTF-1q for pgsql-bugs@arkaria.postgresql.org; Tue, 02 Dec 2025 17:45:52 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vQURk-009HT7-0t for pgsql-bugs@lists.postgresql.org; Tue, 02 Dec 2025 17:45:52 +0000 Received: from mail-ed1-x52b.google.com ([2a00:1450:4864:20::52b]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vQURi-002m8Q-0w for pgsql-bugs@lists.postgresql.org; Tue, 02 Dec 2025 17:45:52 +0000 Received: by mail-ed1-x52b.google.com with SMTP id 4fb4d7f45d1cf-640c1fda178so10851583a12.1 for ; Tue, 02 Dec 2025 09:45:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec.at; s=google; t=1764697548; x=1765302348; darn=lists.postgresql.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:from:to:cc:subject:date :message-id:reply-to; bh=oVWXIJskku6ywZ7O3qmrF23lI8v+wEJ6EvGYnO5hp0E=; b=LIV0fRTfU+SgI4nc7lRMYCH7qXmg4MnJZ4Y6Y09QIMgtSCif1gKfKRKnUgdqCSzmpI KdG4eYe7RHtN84chCkF/UUAkU66+UTAdyDmNfPq5bIDIgQ6fuq2K3AGa5Oj4EMof3MTs 7wneZX1Kb+Q8P2vZ+TWTAizV+MpbDsX7L9+Hoc95gECZu2VjUGM5UKoCrhXNeG6/J7XQ 9pHBd7y9XKIAjOIkPVUyDsBNgGDb72iLitDs0sYp1UxN5MbWWIUZpXmCG6swgx2R1mgo lQ6SjTQ6tJP4r5ObJGHjZDztoHaFeeD7WKYcXbC/0HUjquV6nIuttPUkpE9HmTHcHYZ2 C8fQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764697548; x=1765302348; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=oVWXIJskku6ywZ7O3qmrF23lI8v+wEJ6EvGYnO5hp0E=; b=K3M8DFxIGrPju9MfCTue1CzWH9taBA30wd1yCA5S21dyu3i64ub1zjGGPiVQNMDs1P 4BAFOxGUZdF8hKiu9nIdC7VplFrLPuBRRf8txtB/OFzaMbFQM8EYspXo6lm9/BQ3W7EG VxwvU9ZK07npjMyYWWSY0JO9kxFCmTmhyJ4hHbZp0SuXA/M9y9EeslTAUK0YSKAcFV2u OpSz8FMCywkqBnlXkUb8Oi3QLCD6GYXPEwaoG3l6BtgoXKpDLqHNwcREk8YhRfbNGxAA xadBqjMM+D3LdgAfzw0fPIY8Qc6Zfzy5LTdRGGGnpRQLh5LrF15Tm4g8QuGvZH6qtMNv 2IJQ== X-Forwarded-Encrypted: i=1; AJvYcCW1cweqQgIq2zLlab250aupjQLBB4x1A3u0x6INcUeS3OGJcx0YtWMC0MtImIX6WbqAkR/UU0ZI4t+z@lists.postgresql.org X-Gm-Message-State: AOJu0Yxi7KsK5/65+yL485rANG7SGDm/O+JxCZb0uWOpkDHjOk5Kwg7J 9c0upbP5Mn6ZYcU69xyj83Um0jyNU6EdHStt/My9CUWxO0QAxleV8040Ix1WkHcLrBU= X-Gm-Gg: ASbGnctV2AP/lATKdA91UsI+rI+pbuFisI4rJseF0Xk2316pnrAtI89UwehWszhMgZF hJupTYADu6M5HkSwQjHHGSDTWOaw1T3zyYglB32xkpVgFvh76lnlfaSJv/U7dPJO0vXwKnfOaUX m8Kol9G4TVkI0w7x/2NXXnmszQJ6vhdVeBNA9ULOb9jTHh13b6DUyYaIeEK/4/00DSr+pOa+vmG BVzgHbDFyLO005YnhSBsqPqHqk1Wa/surkQO9t06g4UfFN3mECVnbsCeW/bVAJOeJywPcnjlDxa xEjhPxnc9fJQmbt0VyW5ygd0lpBh6pyAKTPaSQj6ddRo1amP1N4FNWzzoDF9IB406DxdUcDbDpg aFcIEqgCqQud9CR6ansqdEJkdtIA+dTPb9DxtOZZN1n5DYigGX+Y9Vyf8INwsuNs8l7nRMp51fZ RFQ8n9tjYZQDYsGjjxn18EBCWYDUM6WuMJD1tSqABi X-Google-Smtp-Source: AGHT+IGuBl5Ue/zJjJfFMAH09kZuUs6xJfcLNB5b1s6qa8fM9AUKVAzgnzkVMKAkyO459uR2ffAleA== X-Received: by 2002:a05:6402:35d3:b0:641:78b7:d326 with SMTP id 4fb4d7f45d1cf-64794f7fb91mr438260a12.28.1764697548581; Tue, 02 Dec 2025 09:45:48 -0800 (PST) Received: from laurenz.albe-K4N0CV00F97414D ([2001:871:70:4d50:82d5:e2a3:8d7d:8548]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-64750a6ea6esm16344668a12.6.2025.12.02.09.45.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Dec 2025 09:45:48 -0800 (PST) Message-ID: <9e6f15bbd30f8d64027ee32551bdcaed9506fc9f.camel@cybertec.at> Subject: Re: BUG #19341: REPLACE() fails to match final character when using nondeterministic ICU collation From: Laurenz Albe To: Heikki Linnakangas , adam.warland@infor.com, pgsql-bugs@lists.postgresql.org Date: Tue, 02 Dec 2025 18:45:47 +0100 In-Reply-To: <6387cb3e-aec8-41a0-acef-bacdbfb435db@iki.fi> References: <19341-1d9a22915edfec58@postgresql.org> <60b467ac47d5c6bbb9c21c3bdfecce8e5de60cda.camel@cybertec.at> <6935ea1e-cfb1-400b-9057-3d43b55d621a@iki.fi> <6387cb3e-aec8-41a0-acef-bacdbfb435db@iki.fi> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.56.2 (3.56.2-2.fc42) MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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=20 > right. I added the following to collate.icu.utf test: >=20 > +-- 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 | co=CC=82te | coma > + 3 | cote=CC=81 | coma > + 4 | co=CC=82te=CC=81 | coma > +(4 rows) > + >=20 > In the added test query, the accents on the 'o' are stripped, which=20 > 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 "co=CC=82ma" should be the same). But it seems unrelated to the bug report at hand. Yours, Laurenz Albe