Re: Remaining dependency on setlocale()

From: Jeff Davis <pgsql(at)j-davis(dot)com>
To: Peter Eisentraut <peter(at)eisentraut(dot)org>, Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Remaining dependency on setlocale()
Date: 2025-07-01 15:06:51
Message-ID: 800bbb5ae65267d93eb116dbb11b3274a0de1778.camel@j-davis.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, 2025-06-11 at 12:15 -0700, Jeff Davis wrote:
> I changed this to a global_libc_locale that includes both LC_COLLATE
> and LC_CTYPE (from datcollate and datctype), in case an extension is
> relying on strcoll for some reason.

..

> This patch series, at least so far, is designed to have zero behavior
> changes. Anything with a potential for a behavior change should be a
> separate commit, so that if we need to revert it, we can revert the
> behavior change without reintroducing a setlocale() dependency.

...

>
> I reworked it to be less confusing by changing wchar2char/char2wchar
> to
> take a locale_t instead of pg_locale_t. Hopefully it's an
> improvement.

...

>
> Changed it so that it only sets LC_COLLATE to C, and leaves LC_CTYPE
> set to datctype.

Attached rebased v3.

Regards,
Jeff Davis

Attachment Content-Type Size
v3-0001-Hold-datcollate-datctype-in-global_libc_locale.patch text/x-patch 5.1 KB
v3-0002-fuzzystrmatch-use-global_libc_locale.patch text/x-patch 3.6 KB
v3-0003-ltree-use-global_libc_locale.patch text/x-patch 666 bytes
v3-0004-Use-global_libc_locale-for-downcase_identifier-an.patch text/x-patch 2.8 KB
v3-0005-Change-wchar2char-and-char2wchar-to-accept-a-loca.patch text/x-patch 7.4 KB
v3-0006-tsearch-use-global_libc_locale.patch text/x-patch 5.5 KB
v3-0007-Force-LC_COLLATE-to-C-in-postmaster.patch text/x-patch 3.1 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tomas Vondra 2025-07-01 15:11:55 Re: No error checking when reading from file using zstd in pg_dump
Previous Message torikoshia 2025-07-01 14:54:15 Re: Change COPY ... ON_ERROR ignore to ON_ERROR ignore_row