Casefold wording in ILIKE comment

From: Sivaprasad <sivaprasad(dot)postgres(at)gmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Casefold wording in ILIKE comment
Date: 2026-08-04 19:51:33
Message-ID: CAHuJBBHi4JUquo56o=gPtWrUAB2bMoFEDmJkXsFRr4c66NK=eg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi! While going through like_match.c [1], I noticed this comment around line 73:

/*
* MATCH_LOWER is defined for ILIKE in the C locale as an optimization. Other
* locales must casefold the inputs before matching.
*/

The non-C-locale path (Generic_Text_IC_like() in like.c) actually
calls lower(), not a Unicode casefold(), so "casefold" here seems to
overstate what's happening, especially given the ongoing lower() vs
casefold() discussion for ILIKE [2]. Would something like "downcase"
or "lowercase" be more accurate, to avoid implying the casefold
semantics already landed?

Source:
[1] https://github.com/postgres/postgres/blob/master/src/backend/utils/adt/like_match.c#L73
[2] https://www.postgresql.org/message-id/flat/64d7949bad90545f981ac7513fb0b4954daca2c9.camel%40j-davis.com

Browse pgsql-hackers by date

  From Date Subject
Next Message Masahiko Sawada 2026-08-04 20:25:52 Re: Add a hook for handling logical decoding messages on subscribers.
Previous Message Dinesh Salve 2026-08-04 19:45:05 Add test_bufmgr - algorithm-agnostic tests for the buffer manager