Re: ICU for global collation - Mailing list pgsql-hackers

From Kyotaro Horiguchi
Subject Re: ICU for global collation
Date
Msg-id 20220915.155210.529619933474389138.horikyota.ntt@gmail.com
Whole thread Raw
In response to Re: ICU for global collation  (Marina Polyakova <m.polyakova@postgrespro.ru>)
Responses Re: ICU for global collation
Re: ICU for global collation
List pgsql-hackers
At Wed, 14 Sep 2022 17:19:34 +0300, Marina Polyakova <m.polyakova@postgrespro.ru> wrote in 
> Hello!
> 
> I was surprised that it is allowed to create clusters/databases where
> the default ICU collations do not actually work due to unsupported
> encodings:
> 
> $ initdb --encoding SQL_ASCII --locale-provider icu --icu-locale en-US
> -D data &&
> pg_ctl -D data -l logfile start &&
> psql -c "SELECT 'a' < 'b'" template1
> ...
> waiting for server to start.... done
> server started
> ERROR:  encoding "SQL_ASCII" not supported by ICU

Indeed. If I did the following, the direction of the patch looks fine
to me.

If I executed initdb as follows, I would be told to specify
--icu-locale option.

> $ initdb --encoding sql-ascii --locale-provider icu hoge
> ...
> initdb: error: ICU locale must be specified

However, when I reran the command, it complains about incompatible
encoding this time.  I think it's more user-friendly to check for the
encoding compatibility before the check for missing --icu-locale
option.

regards.

-- 
Kyotaro Horiguchi
NTT Open Source Software Center



pgsql-hackers by date:

Previous
From: Jaime Casanova
Date:
Subject: Re: START_REPLICATION SLOT causing a crash in an assert build
Next
From: John Naylor
Date:
Subject: Re: New strategies for freezing, advancing relfrozenxid early