new environment variable INITDB_LOCALE_PROVIDER

From: Jeff Davis <pgsql(at)j-davis(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: new environment variable INITDB_LOCALE_PROVIDER
Date: 2025-07-29 23:55:31
Message-ID: 7d424dc0b032b30a22220634d12377bf59524bdb.camel@j-davis.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

$SUBJECT makes it easier to test other providers, especially the
regression tests.

For this to be useful, it should avoid throwing an error for plain
"initdb" (without locale flags specified), which means we need defaults
for the builtin locale or the ICU locale. I chose "C.UTF-8" and "und"
(we could also have environment variables for those too, but that would
create some questions when --locale is also specified).

Another benefit is that this would make it easier to change the initdb
default, which is being discussed here:

https://www.postgresql.org/message-id/9b259f4c532943e428e9665122f37c099bab250e.camel@j-davis.com

One annoyance is that the tests don't pass when
INITDB_LOCALE_PROVIDER=icu. That's because a lot of tests use either --
locale=C or --no-locale, and ICU doesn't have a way to interpret that.
We could force the provider to be builtin in that case, I suppose.

Another annoyance is that, if INITDB_LOCALE_PROVIDER=builtin, and
LC_CTYPE is not UTF-8-compatible, then we need to force LC_CTYPE=C.
That affects fewer things than it would with the libc provider, but it
still affects some things.

Regards,
Jeff Davis

Attachment Content-Type Size
v1-0001-initdb-new-environment-variable-INITDB_LOCALE_PRO.patch text/x-patch 10.3 KB

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeff Davis 2025-07-30 00:06:19 Re: pg_dump --with-* options
Previous Message Iván Chavero 2025-07-29 23:11:29 Re: libxml2 author overwhelmed with security requests