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 1wCAtv-001jTA-1E for pgsql-hackers@arkaria.postgresql.org; Mon, 13 Apr 2026 06:36:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wCAts-0054WQ-0w for pgsql-hackers@arkaria.postgresql.org; Mon, 13 Apr 2026 06:36:01 +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 1wCAtr-0054WI-2w for pgsql-hackers@lists.postgresql.org; Mon, 13 Apr 2026 06:36:00 +0000 Received: from smtp.outgoing.loopia.se ([93.188.3.37]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wCAtq-00000000n6f-2Cxv for pgsql-hackers@postgresql.org; Mon, 13 Apr 2026 06:36:00 +0000 Received: from s807.loopia.se (localhost [127.0.0.1]) by s807.loopia.se (Postfix) with ESMTP id E092458891A for ; Mon, 13 Apr 2026 08:35:56 +0200 (CEST) Received: from s899.loopia.se (unknown [172.22.191.6]) by s807.loopia.se (Postfix) with ESMTP id D0C37587E33; Mon, 13 Apr 2026 08:35:56 +0200 (CEST) Received: from localhost (unknown [172.22.191.5]) by s899.loopia.se (Postfix) with ESMTP id CDE892C8B912; Mon, 13 Apr 2026 08:35:56 +0200 (CEST) X-Virus-Scanned: amavis at amavis.loopia.se X-Spam-Flag: NO X-Spam-Score: -1.2 X-Spam-Level: X-Spam-Status: No, score=-1.2 tagged_above=-999 required=6.2 tests=[ALL_TRUSTED=-1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1] autolearn=disabled Authentication-Results: s470.loopia.se (amavis); dkim=pass (2048-bit key) header.d=proxel.se Received: from s934.loopia.se ([172.22.191.5]) by localhost (s470.loopia.se [172.22.190.34]) (amavis, port 10024) with LMTP id 8KT2PaL-rdIC; Mon, 13 Apr 2026 08:35:56 +0200 (CEST) X-Loopia-Auth: user X-Loopia-User: andreas@proxel.se X-Loopia-Originating-IP: 90.130.55.50 Received: from ehlo.thunderbird.net (m90-130-55-50.cust.tele2.se [90.130.55.50]) (Authenticated sender: andreas@proxel.se) by s934.loopia.se (Postfix) with ESMTPSA id 42C84917F06; Mon, 13 Apr 2026 08:35:56 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=proxel.se; s=loopiadkim1707418970; t=1776062156; bh=E/EqZ/yVuqUzkAMzNNXO7fqI4i3MYEmXV45USXft5ag=; h=Date:From:To:Subject:In-Reply-To:References; b=TxGRl13Xsz1JwpoxjO7P5rcWaKQp7utACp9dzY1zH5an9od7+TPTceO6maZiSb7JK rRmUVa8DSzG99oAMppSH5GvwBQ/ZJOgwA2hl+lim+vVrR/AA7tGadjQHGJK6uEdvFi xwTsTsj+xsrhXl6r/tycS5y8AIA6m2cE2JHEE3VmpsmWtJWHLOYcCpf3wZsBnfVipp RK/aSFJG+EACG1xWqqmToqgTx6H7qsiMbTbtVwpFt/gStj/ju2v3PH/YZn1hcXt3X3 uok9tpkEawO8FZWdFG2gOVfOTG52yvKuj++lkoMmGdz3/a32Nhi8dXXT8tBLdMrsfV D7xfT+y6xF2Bg== Date: Mon, 13 Apr 2026 08:35:57 +0200 From: Andreas Karlsson To: pgsql-hackers@lists.postgresql.org, Alexander Lakhin , Jeff Davis , zengman , pgsql-hackers Subject: Re: Speed up ICU case conversion by using ucasemap_utf8To*() User-Agent: Thunderbird for Android In-Reply-To: References: <167986ff-afcf-4542-94c6-61ee8474e138@proxel.se> <72c7c2b5848da44caddfe0f20f6c7ebc7c0c6e60.camel@j-davis.com> <4cfde442-25dd-495f-8d76-a23502ce17b8@proxel.se> <744b9998-4463-4be5-b60e-a960eeb43202@proxel.se> <5a010b27-8ed9-4739-86fe-1562b07ba564@proxel.se> <96d80a47-f17f-42fa-82b1-2908efbd6541@gmail.com> Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 1 April 2026 02:46:23 CEST, Andreas Karlsson wrote= : >My proposed fix is that we allocate a ULOC_LANG_CAPACITY buffer for the l= anguage like we do in fix_icu_locale_str() instead of trying to be clever= =2E An alternative would be to use strncmp("tr", lang, 3) but that seems to= o clever for my taste in something which is not performance critical=2E A t= hird option would be to check for U_STRING_NOT_TERMINATED_WARNING but I thi= nk that would just be unnecessarily convoluted code=2E > >I have attached my proposed fix=2E Since it is likely I introduced or at least exposed this bug somehow I am = adding this to the open items for PG 19=2E Andreas