Avoid global LC_CTYPE dependency in pg_locale_icu.c. master github/master
authorJeff Davis <[email protected]>
Tue, 16 Dec 2025 23:32:57 +0000 (15:32 -0800)
committerJeff Davis <[email protected]>
Tue, 16 Dec 2025 23:32:57 +0000 (15:32 -0800)
commit0a90df58cf38cf68d59c6841513be98aeeff250e
tree292d9630aed3581f5b6c915ccf21854a0bda358e
parent87b2968df0f866aaccb6ba69adf284e3c4a79454
Avoid global LC_CTYPE dependency in pg_locale_icu.c.

ICU still depends on libc for compatibility with certain historical
behavior for single-byte encodings. Make the dependency explicit by
holding a locale_t object when required.

We should consider a better solution in the future, such as decoding
the text to UTF-32 and using u_tolower(). That would be a behavior
change and require additional infrastructure though; so for now, just
avoid the global LC_CTYPE dependency.

Reviewed-by: Chao Li <[email protected]>
Discussion: https://postgr.es/m/450ceb6260cad30d7afdf155d991a9caafee7c0d[email protected]
src/backend/utils/adt/pg_locale_icu.c
src/include/utils/pg_locale.h