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 1vQYBB-00ArWX-0q for pgsql-bugs@arkaria.postgresql.org; Tue, 02 Dec 2025 21:45:01 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vQYB8-00A5eH-2O for pgsql-bugs@arkaria.postgresql.org; Tue, 02 Dec 2025 21:44:59 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vQYB8-00A5e9-1S for pgsql-bugs@lists.postgresql.org; Tue, 02 Dec 2025 21:44:58 +0000 Received: from mail-ej1-x644.google.com ([2a00:1450:4864:20::644]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vQYB5-002ofi-2T for pgsql-bugs@lists.postgresql.org; Tue, 02 Dec 2025 21:44:57 +0000 Received: by mail-ej1-x644.google.com with SMTP id a640c23a62f3a-b79d6a70fc8so4150566b.0 for ; Tue, 02 Dec 2025 13:44:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec.at; s=google; t=1764711895; x=1765316695; darn=lists.postgresql.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=BMwqd2lUXQu5NDqF+CUaXpK4MgMwjJqzEN6+qd85/Bg=; b=CbOnnXT1djOYdajzr0GgC276/R8VOAwvY15Ul9nQ8Oav+lZMr5EbGAa1I3R2K3K9Vr spnRUu16qYzyDkJuWppKGjm86VIZ5GkEmzQ5i6aEyZYJ1dL5Fm3O+8b6KuLu3EbRbgd7 /gBNQhIuchAOpGV3g55u2K2gOyLgS/HdSmAS8cWjtrL81UoP9KpztJ/sj64nJt4ucocv p57kXY6fXWqtfKzBEOW3uF7npubGgiKjAXkMpS4ay2d/RnjhT5LGttsKxYLENLE7WLfG DoxgR2FksLmWrk7nxR+49LrNOq1ACHRAKMrOX7gHnBcCYX0QXhnzTVDqJtkwU/rcb2Te 6/gg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764711895; x=1765316695; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=BMwqd2lUXQu5NDqF+CUaXpK4MgMwjJqzEN6+qd85/Bg=; b=MVXIUkuJYsk2JYBpTLxlh1v5OT2MvhEr8gYJii1dXMwQzLjf2lsHgZGEr45eL10Cvl yYuKiRWXKkaAjTlZgYQPzH5wd300UUeNWePZJfvUByDAEXDQKxaQ9sB2vReU4kyyOZbz mAIosqQqMLaJNupeH4kobBX9jLzv530r2D1UJA9fcQp7Ggh2ziq9wNdSBpv1rBnO4MaJ 7eb+DPi26HjfEYULdlQlhU7nv1dO4P2DhfOfj4bs4EHadAtENVt/6adgcnFg7RB9pbWx VqFkk5Uy2zRaeT7UZbfiKXLzkRvgZSvyZDOfNxwV031jG43VK0JTggqu4CbnJ3x9wzvD 74ug== X-Forwarded-Encrypted: i=1; AJvYcCVE6Z2axNMela/gBDcqXsAJrYtwlvCqpLTJyeb8KCeAY1Zk4h2x/Np8jZGVd43hnXGMOwxuSJs5c6b4@lists.postgresql.org X-Gm-Message-State: AOJu0YwG1JUtJRwdP0cPKJlQG4IneXhNgjX6TVLsHmg81Zn0+yTsmdTB B3HyU51YWJSWEF0col02dM22Et9EojhzHeLfLjSOZyrUR1iB1d9cmxceXe4BOdhliaU= X-Gm-Gg: ASbGncuwAlM7dd+aOp9/iXe2U+cS38DNG6Yt13EzQN9PM8MwJ243+6GKfoK17W0K6xB l+owDMuev7f+0MRETWjDHsWEnHavJr5P1NcDfDUU4JDcnhFanJ7Cy2+7yGIUHkTopukLN1WHeTy QUb2XasWJoikn/ACWQOWwJ1r1OlVQ2aP/g7AFbG3/q3D00FVgFQuoAEJbKtO6Ldl5cUW3z9WZXY aWKFLBd36PTsjh0fpXBuXkBRMslnF9yTS3nL2ZPDs3fwtVgHiTlCPa0aTeCjKfZZ6NipNxJSCCk JF8q8V7em7CnyLUlVkV+/1cYUGSkYTH35MYm60LGkty4wgERX25WyUIbw+4OiNqMSfCiJvnRiCf j2gkqBQsqy+VkT+v8l3reIhw26Yu937f9CmqCK/1iSj9ed035GJIomDztmknvNt8b1ezoz2FN0x FoF5GEzBpXijqBlMELBRnXnk66GGkhfYOHx26XDWGQ X-Google-Smtp-Source: AGHT+IFUAsv358fHk+LaUTl+1GHBnEmKmCCM7DlLRUmg98hrrkYae9lWdIFZXXiKnk0IHZNq3TijDA== X-Received: by 2002:a17:907:3f25:b0:b72:aaae:1b22 with SMTP id a640c23a62f3a-b767150b109mr5223560566b.12.1764711894706; Tue, 02 Dec 2025 13:44:54 -0800 (PST) Received: from laurenz.albe-K4N0CV00F97414D ([2001:871:270:1ce:374:d99c:26de:53b0]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b76f5a265d4sm1604339466b.60.2025.12.02.13.44.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Dec 2025 13:44:54 -0800 (PST) Message-ID: Subject: Re: BUG #19341: REPLACE() fails to match final character when using nondeterministic ICU collation From: Laurenz Albe To: Tom Lane Cc: Heikki Linnakangas , adam.warland@infor.com, pgsql-bugs@lists.postgresql.org, peter@eisentraut.org Date: Tue, 02 Dec 2025 22:44:53 +0100 In-Reply-To: <436944.1764708826@sss.pgh.pa.us> References: <19341-1d9a22915edfec58@postgresql.org> <60b467ac47d5c6bbb9c21c3bdfecce8e5de60cda.camel@cybertec.at> <6935ea1e-cfb1-400b-9057-3d43b55d621a@iki.fi> <9f47c6b24d6cf59002603caf19b8b3f4854176be.camel@cybertec.at> <375807.1764696352@sss.pgh.pa.us> <464a14fcbee9567ace136716714b8c18f9bd87fb.camel@cybertec.at> <436944.1764708826@sss.pgh.pa.us> 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 15:53 -0500, Tom Lane wrote: > On the other hand ... is that comment really right about zero-length > match being possible?=C2=A0 If it is, the API for this function is in > need of redesign, because callers that try to find "the next match" > would go into an infinite loop re-finding the same zero-length > match over and over. I know too little about exotic collations to answer that, but it sure would be a problem. All I find in the discussion is the claim by Peter E. in [1] that it is so. Perhaps he can enlighten us. Yours, Laurenz Albe [1]: https://postgr.es/m/6107daa2-5cf7-4cf2-a526-626be1d15b18%40eisentraut= .org