Re: Collation & ctype method table, and extension hooks

From: Jeff Davis <pgsql(at)j-davis(dot)com>
To: Noah Misch <noah(at)leadboat(dot)com>
Cc: Andreas Karlsson <andreas(at)proxel(dot)se>, pgsql-hackers(at)postgresql(dot)org, Peter Eisentraut <peter(at)eisentraut(dot)org>
Subject: Re: Collation & ctype method table, and extension hooks
Date: 2026-07-06 21:31:06
Message-ID: 9f7b9f8b3689f8d78fcdb4f246f25b9b25ca001c.camel@j-davis.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, 2026-06-29 at 18:29 -0700, Noah Misch wrote:
> This became refactor commit 5a38104.  In a UTF8 database, the commit
> changed
> the behavior of:
>
>   SELECT 'café' ILIKE 'caf_' COLLATE "C";
>
> That query reports true in v18, false in v19.

Thank you for the report! Fixed in 0001, with test.

>   I've copied Claude's whole
> review for the commit to
> https://docs.google.com/document/d/19_xKpKUQlY5N51qbfXyipXs3rqIYEC3qk5oaUDJ48YA/edit?tab=t.0
> .
> Two of its other findings sound potentially important, but I didn't
> verify
> them.

I'll refer to the issue numbers below (NB: the doc's summary uses
different numbering, which is confusing):

Issue 1: Real issue for windows and code points > 0xFFFF. Other cases
are just defensive, I believe. Fixed in 0003.

Issue 2: I don't see an issue here, though sort of related to the fix
in 0003.

Issue 3: I don't see an issue here.

Issue 4: The issue you raised above; fixed in 0001.

Issue 5: I don't see an issue here.

I also addressed summary item 4, the comment block fix, in 0002. And I
added some missing casts in 0004.

Does that cover the two other findings you were concerned about?

In the future, if practical, can you please include reports like this
as text attachments for the sake of the archives?

Regards,
Jeff Davis

Attachment Content-Type Size
v1-0001-Fix-unintentional-behavior-change-from-5a38104b36.patch text/x-patch 2.3 KB
v1-0002-Fix-obsolete-comment.patch text/x-patch 1.1 KB
v1-0003-pg_locale_libc.c-add-guards-to-ctype-methods.patch text/x-patch 6.6 KB
v1-0004-pg_locale_libc.c-add-missing-casts-to-unsigned-ch.patch text/x-patch 1.9 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeff Davis 2026-07-06 21:33:00 Selectivity fix for like_fixed_prefix_ci()
Previous Message Bryan Green 2026-07-06 21:28:14 Re: pg_threads.h take II