linkend="icu-language-tag">Language Tag.
when using the ICU provider, specify the canonical
linkend="icu-language-tag">language tag instead of relying on the
transformation.
the following warning:
-CREATE COLLATION nonsense (PROVIDER = icu, LOCALE = 'nonsense');
+CREATE COLLATION nonsense (provider = icu, locale = 'nonsense');
WARNING: ICU locale "nonsense" has unknown language "nonsense"
HINT: To disable ICU locale validation, set parameter icu_validation_level to DISABLED.
CREATE COLLATION
still be created, but the behavior may not be what the user intended.
+
Language Tag
of digits as a single number:
-CREATE COLLATION mycollation5 (PROVIDER = icu, DETERMINISTIC = false, LOCALE = 'en-US-u-kn-ks-level2');
+CREATE COLLATION mycollation5 (provider = icu, deterministic = false, locale = 'en-US-u-kn-ks-level2');
SELECT 'aB' = 'Ab' COLLATE mycollation5 as result;
result
--------
-- ignore differences in accents and case
-CREATE COLLATION ignore_accent_case (PROVIDER = icu, DETERMINISTIC = false, LOCALE = 'und-u-ks-level1');
+CREATE COLLATION ignore_accent_case (provider = icu, deterministic = false, locale = 'und-u-ks-level1');
SELECT 'Å' = 'A' COLLATE ignore_accent_case; -- true
SELECT 'z' = 'Z' COLLATE ignore_accent_case; -- true
-- upper case letters sort before lower case.
-CREATE COLLATION upper_first (PROVIDER=icu, LOCALE = 'und-u-kf-upper');
+CREATE COLLATION upper_first (provider = icu, locale = 'und-u-kf-upper');
SELECT 'B' < 'b' COLLATE upper_first; -- true
-- treat digits numerically and ignore punctuation
-CREATE COLLATION num_ignore_punct (PROVIDER = icu, DETERMINISTIC = false, LOCALE = 'und-u-ka-shifted-kn');
+CREATE COLLATION num_ignore_punct (provider = icu, deterministic = false, locale = 'und-u-ka-shifted-kn');
SELECT 'id-45' < 'id-123' COLLATE num_ignore_punct; -- true
SELECT 'w;x*y-z' = 'wxyz' COLLATE num_ignore_punct; -- true
linkend="icu-collation-settings-table">collation settings. Higher
levels correspond to finer textual features.
+ shows which textual feature
+ differences are considered significant when determining equality at the
+ given level. The unicode character U+2063 is an
+ invisible separator, and as seen in the table, is ignored for at all
+ levels of comparison less than identic.
+
- The above table shows which textual feature differences are
- considered significant when determining equality at the given level. The
- unicode character U+2063 is an invisible separator,
- and as seen in the table, is ignored for at all levels of comparison less
- than identic.
-
At every level, even with full normalization off, basic normalization is
performed. For example, 'á' may be composed of the
code points U&'\0061\0301' or the single code
point U&'\00E1', and those sequences will be
considered equal even at the identic level. To treat
any difference in code point representation as distinct, use a collation
- created with DETERMINISTIC set to
+ created with deterministic set to
true.
-CREATE COLLATION level3 (PROVIDER=icu, DETERMINISTIC=false, LOCALE='und-u-ka-shifted-ks-level3');
-CREATE COLLATION level4 (PROVIDER=icu, DETERMINISTIC=false, LOCALE='und-u-ka-shifted-ks-level4');
-CREATE COLLATION identic (PROVIDER=icu, DETERMINISTIC=false, LOCALE='und-u-ka-shifted-ks-identic');
+CREATE COLLATION level3 (provider = icu, deterministic = false, locale = 'und-u-ka-shifted-ks-level3');
+CREATE COLLATION level4 (provider = icu, deterministic = false, locale = 'und-u-ka-shifted-ks-level4');
+CREATE COLLATION identic (provider = icu, deterministic = false, locale = 'und-u-ka-shifted-ks-identic');
-- invisible separator ignored at all levels except identic
SELECT 'ab' = U&'a\2063b' COLLATE level4; -- true
+
Collation Settings for an ICU Locale
+ shows the available
+ collation settings, which can be used as part of a language tag to
+ customize a collation.
+
ICU Collation Settings
|
- ks
- level1, level2, level3, level4, identic>
- level3
+ co
+ emoji, phonebk, standard, ...>
+ standard
- Sensitivity (or "strength") when determining equality, with
- level1 the least sensitive to differences and
- identic the most sensitive to differences. See
- for details.
+ Collation type. See for additional options and details.
|
before 'aé'.
- |
- kk
- true, false
- false
-
- Enable full normalization; may affect performance. Basic
- normalization is performed even when set to
- false. Locales for languages that require full
- normalization typically enable it by default.
-
- Full normalization is important in some cases, such as when
- multiple accents are applied to a single character. For example,
- the code point sequences U&'\0065\0323\0302'
- and U&'\0065\0302\0323' represent
- an e with circumflex and dot-below accents
- applied in different orders. With full normalization
- on, these code point sequences are treated as equal; otherwise they
- are unequal.
-
-
-
|
kc
true, false
'id-123'.
+ |
+ kk
+ true, false
+ false
+
+ Enable full normalization; may affect performance. Basic
+ normalization is performed even when set to
+ false. Locales for languages that require full
+ normalization typically enable it by default.
+
+ Full normalization is important in some cases, such as when
+ multiple accents are applied to a single character. For example,
+ the code point sequences U&'\0065\0323\0302'
+ and U&'\0065\0302\0323' represent
+ an e with circumflex and dot-below accents
+ applied in different orders. With full normalization
+ on, these code point sequences are treated as equal; otherwise they
+ are unequal.
+
+
+
|
kr
+ |
+ ks
+ level1, level2, level3, level4, identic
+ level3
+
+ Sensitivity (or "strength") when determining equality, with
+ level1 the least sensitive to differences and
+ identic the most sensitive to differences. See
+ for details.
+
+
|
kv
to level3 or lower to take effect.
- |
- co
- emoji, phonebk, standard, ...
- standard
-
- Collation type. See for additional options and details.
-
-
For many collation settings, you must create the collation with
- set to false for the
+ set to false for the
setting to have the desired effect (see
linkend="collation-nondeterministic"/>). Additionally, some settings
only take effect when the key ka is set to
+
Examples
+
External References for ICU