Re: new environment variable INITDB_LOCALE_PROVIDER

From: Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>
To: Jeff Davis <pgsql(at)j-davis(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: new environment variable INITDB_LOCALE_PROVIDER
Date: 2025-10-10 04:13:24
Message-ID: 363CC188-1793-4040-BB84-1D73CC467F81@gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> On Oct 9, 2025, at 12:27, Jeff Davis <pgsql(at)j-davis(dot)com> wrote:
>
> * 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.

Overall the code looks good to me. I do have a question about the design here.

Are we assuming that

* if the settings come from command line options, then the user is intentionally doing that, so we throw an error
* if the settings come from env, then the user might not be aware of them, so we only issue a warning?

If that’s the case, I’m not fully convinced by this design. Since initdb is a one-time operation, I think it would be better to require everything to be explicit.

Best regards,
--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Fujii Masao 2025-10-10 05:52:02 Re: Invalid primary_slot_name triggers warnings in all processes on reload
Previous Message shveta malik 2025-10-10 04:02:30 Re: POC: enable logical decoding when wal_level = 'replica' without a server restart