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: 2024-12-17 18:10:50
Message-ID: 25603d10e678ec2ba1d67569c985fcfacc6e96c3.camel@j-davis.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, 2024-12-17 at 13:14 +0100, Peter Eisentraut wrote:
> I think we will need to keep the global LC_CTYPE setting set to
> something useful, for example so that system error messages come out
> in
> the right encoding.

Do we need to rely on the global LC_CTYPE setting? We already use
bind_textdomain_codeset().

> But I'm concerned about the the Perl_setlocale() dance in plperl.c.
> Perl apparently does a setlocale(LC_ALL, "") during startup, and that
> code is a workaround to reset everything back afterwards.  We need to
> be
> careful not to break that.
>
> (Perl has fixed that in 5.19, but the fix requires that you set
> another
> environment variable before launching Perl, which you can't do in a
> threaded system, so we'd probably need another fix eventually.  See
> <https://github.com/Perl/perl5/issues/8274>.)

I don't fully understand that issue, but I would think the direction we
are going (keeping the global LC_CTYPE more consistent and relying on
it less) would make the problem better.

Regards,
Jeff Davis

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2024-12-17 18:27:07 Re: fixing tsearch locale support
Previous Message Tom Lane 2024-12-17 18:09:49 Re: Adding NetBSD and OpenBSD to Postgres CI