169 похожих чатов

Hi.. we have been using C locale from a long

time as we store data in different types of languages and C provides sort ordering even for different languages.

In pg 14, we started trying out ISU locale specifically und-x-icu as we felt it is providing better sort order capabilities than C locale. We wanted to switch once ICU library is introduced in PG.

It took some time but when I tried initializing postgres 15 using initdb with ICU as locale provider, icu locale property is mandated but it is accepting any random input like abc or Def or temp etc.

initDB.exe --locale-provider=icu --icu-locale=abc

The above command works fine but I'm confused on what locale will be used in this case as lc_collate and lc_ctype are all set to *abc* in above case. A stack overflow post mentioned we need to provide "--locale" option too when using icu locale provider. Is this needed ?

Can anyone let me know how this works? I couldn't find any proper material in Google too. If there something already exists a blog on how this works, please do share. Thank you.

1 ответов

30 просмотров

It seems like you are trying to understand how to use the ICU locale provider with PostgreSQL 15's initdb. The ICU (International Components for Unicode) library provides improved sorting and formatting capabilities for different languages and locales. When you use the command initDB.exe --locale-provider=icu --icu-locale=abc, you are telling PostgreSQL to use the ICU locale provider and setting the ICU locale to "abc". However, "abc" is not a valid ICU locale, so it's not clear what behavior you can expect. In general, when using ICU locales with PostgreSQL, you should provide a valid ICU locale code, such as "en-US-u-kr-true" for US English with the "common" (ko) script. If you don't provide a valid ICU locale, PostgreSQL may still initialize with the ICU locale provider, but the lc_collate and lc_ctype settings will be set to the value you provided (in this case, "abc"), which may not be what you want. The --locale option you mentioned is not needed when using ICU locales with PostgreSQL. This option is used to specify the traditional (non-ICU) locale to use for the database, and is only relevant when not using the ICU locale provider. To learn more about how to use ICU locales with PostgreSQL, you may want to consult the PostgreSQL documentation on localization and ICU: https://www.postgresql.org/docs/current/locale.html https://www.postgresql.org/docs/current/icu.html You may also find it helpful to consult the ICU documentation on locale IDs: https://unicode-org.github.io/icu/userguide/locale/locale_identifiers.html

Похожие вопросы

Обсуждают сегодня

@MrMiscipitlick А можешь макрос написать, который будет вычислять смещение относительно переданных меток? Просто .label1-.label2, и вернуть значение.
КТ315
35
я не магистр хаскеля, но разве не может лейзи тип конвертнуться в не-лейзи запросив вычисление содержимого прям при инициализации?
deadgnom32 λ madao
100
Заметил в ghci 9.4.8: > :t (<*>) @((->)_) (<*>) @((->)_) :: (w -> (a -> b)) -> (w -> a) -> w -> b Разве не должно (w -> (a -> b)) быть записано как (w -> a -> b)? Это баг, ил...
Михаил
13
А еще в перле можно уже @arr1 + @arr2?
Sergei Zhmylove
53
Any electron dev here?
Sayanth Tezro
12
Подобного рода ;Следующие три строки это директивы ассемблера, ;которые можно не задавать, т.к.работаем в Visual Studio. ;Символ ";" - это начало однострочного комментария ...
Егор Анелькин
3
Привет всем. появился вопрос. Разрабатываю сайт, в данный момент он запущен. Хостинг beget. Добавляю на сайт яндекс метрику с помощью полей client-settings (взято отсюда http...
Andrew
2
Кто-нибудь знает почему SPM клонирует репо целиком? Некоторые репы просто огромные, как та же swift-syntax которая нужна для использования макросов. Сначала подумал, что это...
iMike
6
Подскажите, где смотреть результат выполнения программы? Код: ;.686 ;Система команд процессора 686 ;.MODEL FLAT,stdcall ;Модель памяти плоская, станда...
Егор Анелькин
5
Привет. Я верно понимаю, что в определении класса Монад m — зафиксирован (к тому же поскольку это моноид в категории эндофункторов). Т.е. используя байнд я не могу перемещать...
Arseny
5
Карта сайта