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.
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
Обсуждают сегодня