Allow tailoring of ICU locales with custom rules

From: Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Allow tailoring of ICU locales with custom rules
Date: 2022-12-14 09:26:07
Message-ID: 821c71a4-6ef0-d366-9acf-bb8e367f739f@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

This patch exposes the ICU facility to add custom collation rules to a
standard collation. This would allow users to customize any ICU
collation to whatever they want. A very simple example from the
documentation/tests:

CREATE COLLATION en_custom
(provider = icu, locale = 'en', rules = '&a < g');

This places "g" after "a" before "b". Details about the syntax can be
found at
<https://unicode-org.github.io/icu/userguide/collation/customization/>.

The code is pretty straightforward. It mainly just records these rules
in the catalog and feeds them to ICU when creating the collator object.

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

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Daniel Gustafsson 2022-12-14 09:40:45 Re: pg_upgrade: Make testing different transfer modes easier
Previous Message Masahiko Sawada 2022-12-14 09:19:11 Re: Perform streaming logical transactions by background workers and parallel apply