Re: new environment variable INITDB_LOCALE_PROVIDER

From: Jeff Davis <pgsql(at)j-davis(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: new environment variable INITDB_LOCALE_PROVIDER
Date: 2025-10-09 04:27:49
Message-ID: 11a9c9979cd738fc4f3517cf65868f705f584e6e.camel@j-davis.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, 2025-07-29 at 16:55 -0700, Jeff Davis wrote:
> $SUBJECT makes it easier to test other providers, especially the
> regression tests.

Rebased.

Changes:

* Use environment variable name PG_LOCALE_PROVIDER, which seems more
consistent.

* Updated doc.

* If the provider is builtin and the LC_CTYPE or LC_COLLATE environment
variables aren't compatible with UTF-8, it can override those to "C".
But if --locale, --lc-ctype, or --lc-collate are specified and
incompatible, they will throw an error instead.

Note: when the provider is builtin, the overriding of LC_CTYPE and
LC_COLLATE don't matter a lot. LC_CTYPE affects the translation of
messages from the OS (but not Postgres messages), as well as a few
other places that are likely to be fixed soon (e.g. [1]). LC_COLLATE
has no effect when the provider is builtin. In any case, it only
happens when those environment variables aren't compatible with UTF-8,
and the user hasn't specified any locale settings on the command line.
I see this as more of a detail about how the defaults work together
that can easily be corrected if the user specifies something different.

Also note: if PG_LOCALE_PROVIDER=libc (or is unset), there should be no
behavior change with this patch.

I am planning to commit this soon.

Regards,
Jeff Davis

[1]
https://stream.boxwatch.ru/message-id/0151ad01239e2cc7b3139644358cf8f7b9622ff7.camel@j-davis.com

Attachment Content-Type Size
v2-0001-initdb-new-environment-variable-PG_LOCALE_PROVIDE.patch text/x-patch 11.3 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2025-10-09 04:37:16 Re: [PROPOSAL] Termination of Background Workers for ALTER/DROP DATABASE
Previous Message Amit Langote 2025-10-09 04:24:13 Re: sql/json query function JsonBehavior default expression's collation may differ from returning type's collation