Re: pgsql: Allow tailoring of ICU locales with custom rules

From: Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>
To: Jeff Davis <pgsql(at)j-davis(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pgsql: Allow tailoring of ICU locales with custom rules
Date: 2023-03-10 09:54:14
Message-ID: ad36444d-a2ea-7874-68df-34bd22391c3f@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

On 08.03.23 21:57, Jeff Davis wrote:
> On Wed, 2023-03-08 at 16:03 +0000, Peter Eisentraut wrote:
>> Allow tailoring of ICU locales with custom rules
>
> Late review:
>
> * Should throw error when provider != icu and rules != NULL

I have fixed that.

> * Explain what the example means. By itself, users might get confused
> wondering why someone would want to do that.
>
> * Also consider a more practical example?

I have added a more practical example with explanation.

> * 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.

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Eisentraut 2023-03-10 09:59:12 Re: pgsql: Use ICU by default at initdb time.
Previous Message Peter Eisentraut 2023-03-10 08:27:09 pgsql: doc: Better example for custom ICU rules

Browse pgsql-hackers by date

  From Date Subject
Next Message Önder Kalacı 2023-03-10 09:54:48 Re: [PATCH] Use indexes on the subscriber when REPLICA IDENTITY is full on the publisher
Previous Message wangw.fnst@fujitsu.com 2023-03-10 09:36:35 RE: Rework LogicalOutputPluginWriterUpdateProgress