Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1vG00K-005Lcg-Ur for pgsql-hackers@arkaria.postgresql.org; Mon, 03 Nov 2025 19:14:12 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1vG00I-008JBv-Pt for pgsql-hackers@arkaria.postgresql.org; Mon, 03 Nov 2025 19:14:09 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1vG00I-008JBk-BN for pgsql-hackers@lists.postgresql.org; Mon, 03 Nov 2025 19:14:09 +0000 Received: from dverite2024.planet-service.net ([185.16.44.252] helo=mail.verite.pro) by makus.postgresql.org with smtp (Exim 4.96) (envelope-from ) id 1vG00E-005GP0-36 for pgsql-hackers@postgresql.org; Mon, 03 Nov 2025 19:14:08 +0000 Received: by mail.verite.pro (Postfix, from userid 1000) id 333A32C026D; Mon, 3 Nov 2025 20:14:04 +0100 (CET) Content-Type: text/plain; charset="iso-8859-15" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: Remaining dependency on setlocale() From: "Daniel Verite" To: "Jeff Davis" Cc: Thomas Munro , Peter Eisentraut , Tom Lane , pgsql-hackers@postgresql.org In-Reply-To: Date: Mon, 03 Nov 2025 20:14:03 +0100 Message-Id: <5e709c7a-0504-426c-8a7d-e0701c334cd7@manitou-mail.org> X-Mailer: Manitou v1.7.3 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Jeff Davis wrote: > > > Extensions often need to be updated for a new major version. > >=20 > > I think forcing the C locale is not comparable to API changes, > > and the consequences are not even necessarily fixable for extensions. >=20 > Are we in agreement that it's fine for C extensions? No, I think we should put the database's lc_ctype into LC_CTYPE and the database's lc_collate into LC_COLLATE, independently of anything else, like it was done until commit 5e6e42e. I believe that's the purpose of these database properties, whether the provider is libc or ICU or builtin. Forcing "C" is a disruptive change, that IMO does not seem compensated by substantial advantages that would justify the disruption. > > CREATE FUNCTION lt_test(text,text) RETURNS boolean as $$ > > use locale; return ($_[0] lt $_[1])?1:0; > > $$ LANGUAGE plperlu; > >=20 > > select lt_test('a', 'B'); >=20 > 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. plperl users writing "use locale" should understand that it's the libc locale, like when this code is run outside Postgres. Best regards, --=20 Daniel V=E9rit=E9=20 https://postgresql.verite.pro/