Re: Question regarding UTF-8 data and "C" collation on definition of field of table - Mailing list pgsql-general

From Jehan-Guillaume de Rorthais
Subject Re: Question regarding UTF-8 data and "C" collation on definition of field of table
Date
Msg-id 20230209144947.1dfad6c0@karst
Whole thread Raw
In response to Re: Question regarding UTF-8 data and "C" collation on definition of field of table  (Peter Geoghegan <pg@bowt.ie>)
List pgsql-general
On Sun, 5 Feb 2023 17:14:44 -0800
Peter Geoghegan <pg@bowt.ie> wrote:

...
> The OP should see the Postgres ICU docs for hints on how to use these
> facilities to make a custom collation that matches whatever their
> requirements are:
> 
> https://www.postgresql.org/docs/current/collation.html#COLLATION-MANAGING

As you are talking about ICU customization to match whatever the requirement we
want, we were wondering if this would be that easy with ICU to build/create such
custom and odd collation (and not just move numbers after latin)? Even
being able to order letter by letter?

For the record, I helped on an issue last week to sort data using the ebcdic
order. ICU was just a pain, especially with this buggy and annoying bug when
sorting numbers after letters[1] and the fact that it takes whatever we feed it
with without complaining for badly formed or impossible collation. We just gave
up.

One of our recommendation was to write a glibc collation file, built/installed
it using localedef and "import" it in PostgreSQL using
pg_import_system_collations(). The customer actually did it and it works like a
charm.

Regards,

[1] remember ?
https://www.postgresql.org/message-id/flat/20200903105727.064665ce%40firost#0a6e89e58eec7679391c829231a7b3ea



pgsql-general by date:

Previous
From: Joseph Kennedy
Date:
Subject: Re: PostgreSQL
Next
From: Dominique Devienne
Date:
Subject: Using PostgreSQL for service discovery and health-check