Re: Remaining dependency on setlocale() - Mailing list pgsql-hackers

From Daniel Verite
Subject Re: Remaining dependency on setlocale()
Date
Msg-id 9a206ba9-5fff-4884-af95-176f32aa4c39@manitou-mail.org
Whole thread Raw
In response to Re: Remaining dependency on setlocale()  (Jeff Davis <pgsql@j-davis.com>)
Responses Re: Remaining dependency on setlocale()
List 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/



pgsql-hackers by date:

Previous
From: Maciek Sakrejda
Date:
Subject: Re: V18 change on EXPLAIN ANALYZE
Next
From: Jeff Davis
Date:
Subject: Re: Remaining dependency on setlocale()