Re: new environment variable INITDB_LOCALE_PROVIDER - Mailing list pgsql-hackers

From Chao Li
Subject Re: new environment variable INITDB_LOCALE_PROVIDER
Date
Msg-id 363CC188-1793-4040-BB84-1D73CC467F81@gmail.com
Whole thread Raw
In response to Re: new environment variable INITDB_LOCALE_PROVIDER  (Jeff Davis <pgsql@j-davis.com>)
List pgsql-hackers


On Oct 9, 2025, at 12:27, Jeff Davis <pgsql@j-davis.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/




pgsql-hackers by date:

Previous
From: shveta malik
Date:
Subject: Re: POC: enable logical decoding when wal_level = 'replica' without a server restart
Next
From: Fujii Masao
Date:
Subject: Re: Invalid primary_slot_name triggers warnings in all processes on reload