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

Поиск
Список
Период
Сортировка
От Peter Geoghegan
Тема Re: Question regarding UTF-8 data and "C" collation on definition of field of table
Дата
Msg-id CAH2-WzkbWXvDGq2=ytGckKgkj22a7kuweaphY6iOE55_aVjwsw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Question regarding UTF-8 data and "C" collation on definition of field of table  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Question regarding UTF-8 data and "C" collation on definition of field of table  (Jehan-Guillaume de Rorthais <jgdr@dalibo.com>)
Список pgsql-general
On Sun, Feb 5, 2023 at 4:19 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> If there's a predominant language in the data, selecting a collation
> matching that seems like your best bet.  Otherwise, maybe you should
> just shrug your shoulders and stick with C collation.  It's likely
> to be faster than any alternative.

FWIW there are certain "compromise locales" supported by ICU/CLDR.
These include "English (Europe)", and, most notably, EOR (European
Ordering Rules):

https://en.wikipedia.org/wiki/European_ordering_rules

I'm not sure how widely used those are. EOR seems to have been
standardized by the EU or by an adjacent institution, so not sure how
widely used it really is.

It's also possible to use a custom collation with ICU, which is almost
infinitely flexible:

http://www.unicode.org/reports/tr10/#Customization

As an example, the rules about the relative ordering of each script
can be changed this way. There is also something called merged
tailorings.

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

-- 
Peter Geoghegan



В списке pgsql-general по дате отправления:

Предыдущее
От: Dionisis Kontominas
Дата:
Сообщение: Re: Question regarding UTF-8 data and "C" collation on definition of field of table
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Question regarding UTF-8 data and "C" collation on definition of field of table