'query the collation name refer to the specific lanuage?

   CREATE TABLE collate_test2 (
       a int,
       b text COLLATE "sv-x-icu"
   );

what is "sv" mean? I can guess "en" refer to english. Or How can I query the sv refer to which language.

I already did

SELECT * FROM pg_collation where collname ilike '%icu%';

there is no an column refer to the language specification.

I also checked https://unicode-org.github.io/icu/userguide/collation/api.html#references



Solution 1:[1]

sv-SE is locale to Swedish (sv) as spoken in Sweden (SE) (for locale you can check this FAQ). Also I found this answer about the difference between sv and sv-SE for different ISO standards.

-x-ICU is an International Components for Unicode (more info here, and here is the reference for ICU in PG SQL - 24.2.2.2.2. ICU Collations);

Solution 2:[2]

SELECT collname, collversion  FROM pg_collation where collname ilike '%icu%' and  collname ilike '%zh%';

return

     collname     | collversion
------------------+-------------
 zh-x-icu         | 153.14.36.8
 zh-Hans-x-icu    | 153.14.36.8
 zh-Hans-CN-x-icu | 153.14.36.8
 zh-Hans-HK-x-icu | 153.14.36.8
 zh-Hans-MO-x-icu | 153.14.36.8
 zh-Hans-SG-x-icu | 153.14.36.8
 zh-Hant-x-icu    | 153.14.36.8
 zh-Hant-HK-x-icu | 153.14.36.8
 zh-Hant-MO-x-icu | 153.14.36.8
 zh-Hant-TW-x-icu | 153.14.36.8

zh refer to language code: https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes

Hant refer to script code: https://www.unicode.org/iso15924/iso15924-codes.html

CN refer to country code: https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1
Solution 2 Mark