Re: EBCDIC sorting as a use case for ICU rules - Mailing list pgsql-hackers

From Jehan-Guillaume de Rorthais
Subject Re: EBCDIC sorting as a use case for ICU rules
Date
Msg-id 20230824162653.34eb3bad@karst
Whole thread Raw
In response to EBCDIC sorting as a use case for ICU rules  ("Daniel Verite" <daniel@manitou-mail.org>)
List pgsql-hackers
Hi,

Sorry to chime in so lately, I was waiting for some customer feedback.

On Wed, 21 Jun 2023 15:28:38 +0200
"Daniel Verite" <daniel@manitou-mail.org> wrote:

> At a conference this week I was asked if ICU could be able to
> sort like EBCDIC [2].
> It turns out it has been already    asked on
> -general a few years ago [3] with no satisfactory answer at the time ,
> and that it can be implemented with rules in v16.

We worked with a customer few months ago about this question and end up with a
procedure to build new locale/collation for glibc and load them in PostgreSQL
[1].

Our customer built the fr_ebcdic locale file themselves, based on the EBCDIC
IBM500 codepage (including about the same characters than iso 8859-1) and share
it under the BY-CC licence. See in attachment.

The procedure is quite simple:

1. copy this file under "/usr/share/i18n/locales/fr_ebcdic"
2. build it using "localedef -c -i fr_ebcdic -f UTF-8 fr_ebcdic.UTF-8"
3. restart your PostgreSQL instance (because of localeset weird behavior)
4. "pg_import_system_collations('schema')" or create the collation, eg.:
   CREATE COLLATION fr_ebcdic (
     PROVIDER = libc,
     LC_COLLATE = fr_ebcdic.utf8,
     LC_CTYPE = fr_ebcdic.utf8
   );

Now, same question than for the ICU: do we want to provide documentation about
this? Online documentation about such feature are quite arid. In fact, this
could be useful in various other way than just EBCDIC.

Regards,

[1] https://www.postgresql.org/message-id/20230209144947.1dfad6c0%40karst

Attachment

pgsql-hackers by date:

Previous
From: Chapman Flack
Date:
Subject: Re: Vectorization of some functions and improving pg_list interface
Next
From: "Jonathan S. Katz"
Date:
Subject: Re: PostgreSQL 16 release announcement draft