pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Eisentraut <peter@eisentraut.org>
To: pgsql-hackers <pgsql-hackers@postgresql.org>
Cc: Jeff Davis <pgsql@j-davis.com>
Cc: Amit Kapila <amit.kapila16@gmail.com>
Subject: Re: pgsql: Allow tailoring of ICU locales with custom rules
Date: Mon, 14 Aug 2023 10:34:42 +0200
Message-ID: <afdffbd9-98ee-ea03-9640-301463317bc1@eisentraut.org> (raw)
In-Reply-To: <CAA4eK1JLBx18GJyAQ8nv-bnEDqEgmpgSVQtadV_wcSfbQZOs5Q@mail.gmail.com>
References: <E1pZwGA-002X1G-4w@gemulon.postgresql.org>
	<36a6e89689716c2ca1fae8adc8e84601a041121c.camel@j-davis.com>
	<ad36444d-a2ea-7874-68df-34bd22391c3f@enterprisedb.com>
	<CAA4eK1JLBx18GJyAQ8nv-bnEDqEgmpgSVQtadV_wcSfbQZOs5Q@mail.gmail.com>

On 24.07.23 04:46, Amit Kapila wrote:
> On Fri, Mar 10, 2023 at 3:24 PM Peter Eisentraut
> <peter.eisentraut@enterprisedb.com> wrote:
>>
>> On 08.03.23 21:57, Jeff Davis wrote:
>>
>>> * It appears rules IS NULL behaves differently from rules=''. Is that
>>> desired? For instance:
>>>     create collation c1(provider=icu,
>>>       locale='und-u-ka-shifted-ks-level1',
>>>       deterministic=false);
>>>     create collation c2(provider=icu,
>>>       locale='und-u-ka-shifted-ks-level1',
>>>       rules='',
>>>       deterministic=false);
>>>     select 'a b' collate c1 = 'ab' collate c1; -- true
>>>     select 'a b' collate c2 = 'ab' collate c2; -- false
>>
>> I'm puzzled by this.  The general behavior is, extract the rules of the
>> original locale, append the custom rules, use that.  If the custom rules
>> are the empty string, that should match using the original rules
>> untouched.  Needs further investigation.
>>
>>> * Can you document the interaction between locale keywords
>>> ("@colStrength=primary") and a rule like '[strength 2]'?
>>
>> I'll look into that.
> 
> This thread is listed on PostgreSQL 16 Open Items list. This is a
> gentle reminder to see if there is a plan to move forward with respect
> to open points.

I have investigated this.  My assessment is that how PostgreSQL 
interfaces with ICU is correct.  Whether what ICU does is correct might 
be debatable.  I have filed a bug with ICU about this: 
https://unicode-org.atlassian.net/browse/ICU-22456 , but there is no 
response yet.

You can work around this by including the desired attributes in the 
rules string, for example

     create collation c3 (provider=icu,
       locale='und-u-ka-shifted-ks-level1',
       rules='[alternate shifted][strength 1]',
       deterministic=false);

So I don't think there is anything we need to do here for PostgreSQL 16.






view thread (7+ messages)  latest in thread

Message-ID: <afdffbd9-98ee-ea03-9640-301463317bc1@eisentraut.org>
Permalink:  ../afdffbd9-98ee-ea03-9640-301463317bc1@eisentraut.org/
Also on:    postgresql.org/message-id/afdffbd9-98ee-ea03-9640-301463317bc1@eisentraut.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: peter@eisentraut.org, pgsql-hackers@postgresql.org, pgsql@j-davis.com, amit.kapila16@gmail.com
  Subject: Re: pgsql: Allow tailoring of ICU locales with custom rules
  In-Reply-To: <afdffbd9-98ee-ea03-9640-301463317bc1@eisentraut.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox