Re: Remaining dependency on setlocale()

Jeff Davis <pgsql@j-davis.com>

From: Jeff Davis <pgsql@j-davis.com>
To: Daniel Verite <daniel@manitou-mail.org>
Cc: Thomas Munro <thomas.munro@gmail.com>, Peter Eisentraut <peter@eisentraut.org>, Tom Lane <tgl@sss.pgh.pa.us>, pgsql-hackers@postgresql.org
Date: 2025-10-31T15:25:46Z
Lists: 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