Re: Allow tailoring of ICU locales with custom rules

From: Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>
To: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>, Daniel Verite <daniel(at)manitou-mail(dot)org>
Cc: vignesh C <vignesh21(at)gmail(dot)com>, Pgsql-Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Allow tailoring of ICU locales with custom rules
Date: 2023-02-20 09:00:26
Message-ID: 0f4f3747-893e-0610-85aa-f22878122970@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 14.02.23 17:53, Laurenz Albe wrote:
> On Mon, 2023-02-06 at 22:16 +0100, Peter Eisentraut wrote:
>> Right.  Here is a new patch with this fixed.
>
> Thanks. I played some more with it, and still are still some missing
> odds and ends:
>
> - There is a new option ICU_RULES to CREATE DATABASE, but it is not
> reflected in \h CREATE DATABASE. sql_help_CREATE_DATABASE() needs to
> be amended.

Fixed.

> - There is no way to show the rules except by querying "pg_collation" or
> "pg_database". I think it would be good to show the rules with
> \dO+ and \l+.

Fixed. I adjusted the order of the columns a bit, to make the overall
picture more sensible. The locale provider column is now earlier, since
it indicates which of the subsequent columns are applicable.

> - If I create a collation "x" with RULES and then create a database
> with "ICU_LOCALE x", the rules are not copied over.
>
> I don't know if that is intended or not, but it surprises me.
> Should that be a WARNING? Or, since creating a database with a collation
> that does not exist in "template0" doesn't make much sense (or does it?),
> is there a way to forbid that?

This is a misunderstanding of how things work. The value of the
database ICU_LOCALE attribute is passed to the ICU library. It does not
refer to a PostgreSQL collation object.

Attachment Content-Type Size
v5-0001-Allow-tailoring-of-ICU-locales-with-custom-rules.patch text/plain 32.4 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bharath Rupireddy 2023-02-20 09:47:00 Re: pg_walinspect memory leaks
Previous Message John Naylor 2023-02-20 08:30:33 Re: bitscan forward/reverse on Windows