Re: EBCDIC sorting as a use case for ICU rules

From: "Daniel Verite" <daniel(at)manitou-mail(dot)org>
To: "Jeff Davis" <pgsql(at)j-davis(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org, Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>, Jonathan S(dot)Katz <jkatz(at)postgresql(dot)org>
Subject: Re: EBCDIC sorting as a use case for ICU rules
Date: 2023-06-30 11:08:45
Message-ID: 8806553d-9255-42a0-a96f-5551c72d5a95@manitou-mail.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Jeff Davis wrote:

> I still had some technical concerns about the ICU rules feature,
> unfortunately, and one option is to only allow it for the collation
> objects and not the database level collation. How much would that hurt
> this use case?

For a regression test suite that should produce results with the custom
order, not being able to configure the sort rules at the db level means
that you'd have to change all the queries to add explicit COLLATE clauses.
I guess that could be quite annoying if the test suite is large.

About making a doc patch from this, I've came up with the attached,
which generates a CREATE COLLATION statement with rules from an
arbitrary strings that just lists characters in whichever order is desired.

In the case of EBCDIC and code page 37, it turns out that there are
several versions of "code page 37", with more or less additions of
characters outside the US-ASCII range. This is why I decided
to show code that generates the rules rather than an already generated
rule. Users may simply change the codepage_37 string in the code
to add or rearrange any characters.

Also the patch makes the relevant sections of "CREATE COLLATION" and
"CREATE DATABASE" point to "Collation Support" with the idea to
centralize the information on tailoring rules.

I'll add this to the next CF.

Best regards,
--
Daniel Vérité
https://postgresql.verite.pro/
Twitter: @DanielVerite

Attachment Content-Type Size
collation-icu-rules.patch text/plain 4.6 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tomas Vondra 2023-06-30 11:38:06 Re: index prefetching
Previous Message Andrey Lepikhov 2023-06-30 10:50:19 Re: Removing unneeded self joins