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

From Jeff Davis
Subject Re: Remaining dependency on setlocale()
Date
Msg-id a1a184524e11bb4dc8092353a02672cc42a05233.camel@j-davis.com
Whole thread Raw
In response to Re: Remaining dependency on setlocale()  ("Daniel Verite" <daniel@manitou-mail.org>)
Responses Re: Remaining dependency on setlocale()
List pgsql-hackers
On Fri, 2025-10-31 at 15:01 +0100, Daniel Verite wrote:
> > Extensions often need to be updated for a new major version.
>
> I think forcing the C locale is not comparable to API changes,
> and the consequences are not even necessarily fixable for extensions.

Are we in agreement that it's fine for C extensions?

> For instance, consider the following function, when run in a database
> with en_US.utf8 as locale.
>
> CREATE FUNCTION lt_test(text,text) RETURNS boolean as $$
>  use locale; return ($_[0] lt $_[1])?1:0;
> $$ LANGUAGE plperlu;
>
> select lt_test('a', 'B');

Are you aware of PL code that does things like that? If the database
locale is ICU, that would be at least a little bit confusing.

Regards,
    Jeff Davis




pgsql-hackers by date:

Previous
From: Tatsuro Yamada
Date:
Subject: [PATCH] psql: add \dcs to list all constraints
Next
From: Jim Jones
Date:
Subject: Re: [PATCH] Add pg_get_tablespace_ddl() function to reconstruct CREATE TABLESPACE statement