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 1vwKLu-00HNdx-0a for pgsql-hackers@arkaria.postgresql.org; Sat, 28 Feb 2026 13:27:26 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vwKLr-00Aomo-2r for pgsql-hackers@arkaria.postgresql.org; Sat, 28 Feb 2026 13:27:23 +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 1vwKLr-00Aomf-1x for pgsql-hackers@lists.postgresql.org; Sat, 28 Feb 2026 13:27:23 +0000 Received: from dverite2024.planet-service.net ([185.16.44.252] helo=mail.verite.pro) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1vwKLn-00000001lGI-3jqn for pgsql-hackers@postgresql.org; Sat, 28 Feb 2026 13:27:22 +0000 Received: by mail.verite.pro (Postfix, from userid 1000) id D5EB62C911B; Sat, 28 Feb 2026 14:27:17 +0100 (CET) Content-Type: text/plain; charset="iso-8859-15" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 From: "Daniel Verite" Subject: Re: Use CASEFOLD() internally rather than LOWER() To: "Jeff Davis" Cc: pgsql-hackers@postgresql.org In-Reply-To: <64d7949bad90545f981ac7513fb0b4954daca2c9.camel@j-davis.com> Date: Sat, 28 Feb 2026 14:27:12 +0100 Message-Id: X-Mailer: Manitou v1.7.3 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Jeff Davis wrote: > There are a number of internal callers of LOWER(), and conceptually > those should all be using CASEFOLD(). Patches attached. I tried 0001 with a non-UTF8 database and got quickly stuck: create database latin9 encoding=3D'LATIN9'=20 template=3Dtemplate0 locale=3D'fr_FR.ISO-8859-15@euro'; \c latin9 select 'abc' ilike 'bc'; ERROR: Unicode case folding can only be performed if server encoding is UTF8 Presumably the internal calls to casefold should be conditionalized on the encoding being UTF-8? Best regards, --=20 Daniel V=E9rit=E9=20 https://postgresql.verite.pro/