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.94.2) (envelope-from ) id 1uRYNe-00DGaR-Nx for pgsql-hackers@arkaria.postgresql.org; Tue, 17 Jun 2025 15:37:46 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1uRYNc-00Aqa8-Lp for pgsql-hackers@arkaria.postgresql.org; Tue, 17 Jun 2025 15:37:45 +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.94.2) (envelope-from ) id 1uRYNc-00AqZ4-B6 for pgsql-hackers@lists.postgresql.org; Tue, 17 Jun 2025 15:37:45 +0000 Received: from relay2-d.mail.gandi.net ([217.70.183.194]) by makus.postgresql.org with smtp (Exim 4.96) (envelope-from ) id 1uRYNa-002W2n-2n for pgsql-hackers@postgresql.org; Tue, 17 Jun 2025 15:37:43 +0000 Received: by mail.gandi.net (Postfix) with ESMTPSA id 31E7743883; Tue, 17 Jun 2025 15:37:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=postgresfriends.org; s=gm1; t=1750174659; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=9pE2AfEcj4fH5VhyVFpgtBjB5NFW76StUCcqxtC35KA=; b=fjJHCq7kXae4NQpm4DiJIgzk+Z+kDsC3hBI1Cnzkj1Xfj6zvhKpMFgO8HxICim/MIOdrm7 GnEo6orSMPpbOIcyOZo0198q5neNo2OaAyBbeL4v8KinXDdcLn07hjzQOrBsjX3KLZgjkf qYsQ7NZeVu2psycsZzQOKz72Fr2t+v1V4TibP+5yfvtNPJ34b6odQol5U4PAOCJM0eBW0G PHRU7p0ysq/9JwmPALOTX9Rro58s/Sd8rNMTZJYuOc/4SWK2FSBEcze/MGYtvaRm7KBsDt BamG73lVyNOvVnViT8thTZVFOFU/qS1ghV32zwzI9M/y+MEooyZaV4YYR5LzmA== Content-Type: multipart/alternative; boundary="------------TfuxM2hlp337x2elc0SNbILy" Message-ID: <36f69fa9-db3f-44a1-8c8a-95ff09704a9c@postgresfriends.org> Date: Tue, 17 Jun 2025 17:37:37 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Add CASEFOLD() function. To: Jeff Davis , Joe Conway , Ian Lawrence Barwick Cc: pgsql-hackers@postgresql.org, Peter Eisentraut References: <47716a78-eb0b-4728-8991-fc0d958a01c9@joeconway.com> Content-Language: en-US From: Vik Fearing In-Reply-To: X-GND-State: clean X-GND-Score: -100 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtddvgdehiecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfitefpfffkpdcuggftfghnshhusghstghrihgsvgenuceurghilhhouhhtmecufedtudenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurheptgfkffggfgfuvfevfhfhjgesrgdtreertddvjeenucfhrhhomhepgghikhcuhfgvrghrihhnghcuoehvihhksehpohhsthhgrhgvshhfrhhivghnughsrdhorhhgqeenucggtffrrghtthgvrhhnpefgjeefudffffeljeeutdejffffteejuefhteekheehkedtjeektdegjeeggffhtdenucfkphepudelfedrfedvrdduvdeirdduieeinecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepudelfedrfedvrdduvdeirdduieeipdhhvghloheplgdutddrudefgedruddthedrkeekngdpmhgrihhlfhhrohhmpehvihhksehpohhsthhgrhgvshhfrhhivghnughsrdhorhhgpdhnsggprhgtphhtthhopeehpdhrtghpthhtohepphhgshhqlhesjhdquggrvhhishdrtghomhdprhgtphhtthhopehmrghilhesjhhovggtohhnfigrhidrtghomhdprhgtphhtthhopegsrghrfihitghksehgmhgrihhlrdgtohhmpdhrtghpthhtohepphhgshhqlhdqhhgrtghkvghrshesphhoshhtghhrvghsqhhlrdhorhhgpdhrtghpthhtohepphgvthgvrhesvghishgvnhhtrhgruhhtrdhorhhg X-GND-Sasl: vik@postgresfriends.org List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------TfuxM2hlp337x2elc0SNbILy Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 16/12/2024 18:49, Jeff Davis wrote: > One question I have is whether we want this function to normalize the > output. Yes, we do. I am sorry that I am so late to the party, but I am currently writing the Change Proposal for the SQL Standard for this function. For (which includes LOWER() and UPPER()), the text says in Section 6.35 GR 7.e: If the character set of is UTF8, UTF16, or UTF32, then FR is replaced by     Case:         i) If the S IS NORMALIZED evaluates to True, then NORMALIZE (FR)         ii) Otherwise, FR. Here, FR is the result of the function and S is its argument. It does not appear to me that our LOWER and UPPER functions obey this rule, so there is a valid argument that we should continue to ignore it. Or, we can say that we have at least one of three compliant. -- Vik Fearing --------------TfuxM2hlp337x2elc0SNbILy Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit


On 16/12/2024 18:49, Jeff Davis wrote:
One question I have is whether we want this function to normalize the
output.


Yes, we do.


I am sorry that I am so late to the party, but I am currently writing the Change Proposal for the SQL Standard for this function.


For <fold> (which includes LOWER() and UPPER()), the text says in Section 6.35 GR 7.e:


If the character set of <character factor> is UTF8, UTF16, or UTF32, then FR is replaced by
    Case:
        i) If the <search condition> S IS NORMALIZED evaluates to True, then NORMALIZE (FR)
        ii) Otherwise, FR.


Here, FR is the result of the function and S is its argument.


It does not appear to me that our LOWER and UPPER functions obey this rule, so there is a valid argument that we should continue to ignore it. Or, we can say that we have at least one of three compliant.

--

Vik Fearing

--------------TfuxM2hlp337x2elc0SNbILy--