Re: Add CASEFOLD() function.

From: Vik Fearing <vik(at)postgresfriends(dot)org>
To: Jeff Davis <pgsql(at)j-davis(dot)com>, Joe Conway <mail(at)joeconway(dot)com>, Ian Lawrence Barwick <barwick(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org, Peter Eisentraut <peter(at)eisentraut(dot)org>
Subject: Re: Add CASEFOLD() function.
Date: 2025-06-17 15:37:37
Message-ID: 36f69fa9-db3f-44a1-8c8a-95ff09704a9c@postgresfriends.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Sergey Sargsyan 2025-06-17 15:55:54 Re: Revisiting {CREATE INDEX, REINDEX} CONCURRENTLY improvements
Previous Message Daria Shanina 2025-06-17 15:15:32 Re: autoprewarm_dump_now