Re: Remaining dependency on setlocale()

From: "Daniel Verite" <daniel(at)manitou-mail(dot)org>
To: "Jeff Davis" <pgsql(at)j-davis(dot)com>
Cc: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>, Peter Eisentraut <peter(at)eisentraut(dot)org>, 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-10-30 20:41:50
Message-ID: 9a206ba9-5fff-4884-af95-176f32aa4c39@manitou-mail.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Jeff Davis wrote:

> The goal here is to do a permanent:
>
> setlocale(LC_CTYPE, "C")
>
> in the postmaster, and instead use _l() variants where necessary.

What about code in extensions? AFAIU a user can control the
locale in effect by setting the LC_CTYPE argument of
CREATE DATABASE, which ends up in the environment
of backends serving that database.
If it's forced to "C", how can an extension use locale-aware
libc functions?

In theory it's the same problem with LC_COLLATE, except
that functions like tolower()/toupper() are much more likely
to be used in extensions than strcoll().

Best regards,
--
Daniel Vérité
https://postgresql.verite.pro/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeff Davis 2025-10-30 20:53:43 Re: Remaining dependency on setlocale()
Previous Message Maciek Sakrejda 2025-10-30 20:35:27 Re: V18 change on EXPLAIN ANALYZE