pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Avoid global LC_CTYPE dependency in pg_locale_libc.c.
2+ messages / 1 participants
[nested] [flat]

* pgsql: Avoid global LC_CTYPE dependency in pg_locale_libc.c.
@ 2025-11-24 22:57 Jeff Davis <jdavis@postgresql.org>
  0 siblings, 0 replies; 2+ messages in thread

From: Jeff Davis @ 2025-11-24 22:57 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Avoid global LC_CTYPE dependency in pg_locale_libc.c.

Call tolower_l() directly instead of through pg_tolower(), because the
latter depends on the global LC_CTYPE.

Discussion: https://postgr.es/m/8186b28a1a39e61a0d833a4c25a8909ebbbabd48.camel@j-davis.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/f81bf78ce12b9fd3e50eb00dd875440007262ec4

Modified Files
--------------
src/backend/utils/adt/pg_locale_libc.c | 28 ++++++++++++++++++++++++----
1 file changed, 24 insertions(+), 4 deletions(-)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* pgsql: Avoid global LC_CTYPE dependency in pg_locale_icu.c.
@ 2025-12-16 23:42 Jeff Davis <jdavis@postgresql.org>
  0 siblings, 0 replies; 2+ messages in thread

From: Jeff Davis @ 2025-12-16 23:42 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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 <li.evan.chao@gmail.com>
Discussion: https://postgr.es/m/450ceb6260cad30d7afdf155d991a9caafee7c0d.camel@j-davis.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/0a90df58cf38cf68d59c6841513be98aeeff250e

Modified Files
--------------
src/backend/utils/adt/pg_locale_icu.c | 47 ++++++++++++++++++++++++++++++++---
src/include/utils/pg_locale.h         |  1 +
2 files changed, 44 insertions(+), 4 deletions(-)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2025-12-16 23:42 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2025-11-24 22:57 pgsql: Avoid global LC_CTYPE dependency in pg_locale_libc.c. Jeff Davis <jdavis@postgresql.org>
2025-12-16 23:42 pgsql: Avoid global LC_CTYPE dependency in pg_locale_icu.c. Jeff Davis <jdavis@postgresql.org>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox