pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Daniel Verite <daniel@manitou-mail.org>
To: Jeff Davis <pgsql@j-davis.com>
Cc: Thomas Munro <thomas.munro@gmail.com>
Cc: Peter Eisentraut <peter@eisentraut.org>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-hackers@postgresql.org
Subject: Re: Remaining dependency on setlocale()
Date: Mon, 03 Nov 2025 20:14:03 +0100
Message-ID: <5e709c7a-0504-426c-8a7d-e0701c334cd7@manitou-mail.org> (raw)
In-Reply-To: <a1a184524e11bb4dc8092353a02672cc42a05233.camel@j-davis.com>

	Jeff Davis 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?

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;
> > 
> > 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.

plperl users writing "use locale" should understand that
it's the libc locale, like when this code is run outside Postgres.


Best regards,
-- 
Daniel Vérité 
https://postgresql.verite.pro/





view thread (96+ messages)  latest in thread

Message-ID: <5e709c7a-0504-426c-8a7d-e0701c334cd7@manitou-mail.org>
Permalink:  ../5e709c7a-0504-426c-8a7d-e0701c334cd7@manitou-mail.org/
Also on:    postgresql.org/message-id/5e709c7a-0504-426c-8a7d-e0701c334cd7@manitou-mail.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: daniel@manitou-mail.org, pgsql@j-davis.com, thomas.munro@gmail.com, peter@eisentraut.org, tgl@sss.pgh.pa.us
  Subject: Re: Remaining dependency on setlocale()
  In-Reply-To: <5e709c7a-0504-426c-8a7d-e0701c334cd7@manitou-mail.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox