On Thu, 2023-02-02 at 18:10 -0500, Tom Lane wrote:
> Yeah. I would be resistant to making ICU a required dependency,
> but it doesn't seem unreasonable to start moving towards it being
> our default collation support.
Patch attached.
To get the default locale, the patch initializes a UCollator with NULL
for the locale name, and then queries it for the locale name. Then it's
converted to a language tag, which is consistent with the initial
collation import. I'm not sure that's the best way, but it seems
reasonable.
If it's a user-provided locale (--icu-locale=), then the patch leaves
it as-is, and does not convert it to a language tag (consistent with
CREATE COLLATION and CREATE DATABASE).
I opened another discussion about whether we want to try harder to
validate or canonicalize the locale name:
https://www.postgresql.org/message-id/11b1eeb7e7667fdd4178497aeb796c48d26e69b9.camel@j-davis.com
--
Jeff Davis
PostgreSQL Contributor Team - AWS