Home Explore Blog CI



postgresql

22th chunk of `doc/src/sgml/charset.sgml`
11420c325d1e2c07121d675f7ed868f98e56fdefa5d4cea10000000100000fa3
 <entry><literal>level3</literal></entry>
         <entry>
          Sensitivity (or "strength") when determining equality, with
          <literal>level1</literal> the least sensitive to differences and
          <literal>identic</literal> the most sensitive to differences. See
          <xref linkend="icu-collation-levels"/> for details.
         </entry>
        </row>

        <row>
         <entry><literal>kv</literal></entry>
         <entry>
          <literal>space</literal>, <literal>punct</literal>,
          <literal>symbol</literal>, <literal>currency</literal>
         </entry>
         <entry><literal>punct</literal></entry>
         <entry>
          Classes of characters ignored during comparison at level 3. Setting
          to a later value includes earlier values;
          e.g. <literal>symbol</literal> also includes
          <literal>punct</literal> and <literal>space</literal> in the
          characters to be ignored. Key <literal>ka</literal> must be set to
          <literal>shifted</literal> and key <literal>ks</literal> must be set
          to <literal>level3</literal> or lower to take effect.
         </entry>
        </row>
       </tbody>
      </tgroup>
     </table>

    <para>
     Defaults may depend on locale. The above table is not meant to be
     complete. See <xref linkend="icu-external-references"/> for additional
     options and details.
    </para>

    <note>
     <para>
      For many collation settings, you must create the collation with
      <option>deterministic</option> set to <literal>false</literal> for the
      setting to have the desired effect (see <xref
      linkend="collation-nondeterministic"/>). Additionally, some settings
      only take effect when the key <literal>ka</literal> is set to
      <literal>shifted</literal> (see <xref
      linkend="icu-collation-settings-table"/>).
     </para>
    </note>
   </sect3>

   <sect3 id="icu-locale-examples">
    <title>Collation Settings Examples</title>

     <variablelist>
      <varlistentry id="collation-managing-create-icu-de-u-co-phonebk-x-icu">
       <term><literal>CREATE COLLATION "de-u-co-phonebk-x-icu" (provider = icu, locale = 'de-u-co-phonebk');</literal></term>
       <listitem>
        <para>German collation with phone book collation type</para>
       </listitem>
      </varlistentry>

      <varlistentry id="collation-managing-create-icu-und-u-co-emoji-x-icu">
       <term><literal>CREATE COLLATION "und-u-co-emoji-x-icu" (provider = icu, locale = 'und-u-co-emoji');</literal></term>
       <listitem>
        <para>
         Root collation with Emoji collation type, per Unicode Technical Standard #51
        </para>
       </listitem>
      </varlistentry>

      <varlistentry id="collation-managing-create-icu-en-u-kr-grek-latn">
       <term><literal>CREATE COLLATION latinlast (provider = icu, locale = 'en-u-kr-grek-latn');</literal></term>
       <listitem>
        <para>
         Sort Greek letters before Latin ones.  (The default is Latin before Greek.)
        </para>
       </listitem>
      </varlistentry>

      <varlistentry id="collation-managing-create-icu-en-u-kf-upper">
       <term><literal>CREATE COLLATION upperfirst (provider = icu, locale = 'en-u-kf-upper');</literal></term>
       <listitem>
        <para>
         Sort upper-case letters before lower-case letters.  (The default is
         lower-case letters first.)
        </para>
       </listitem>
      </varlistentry>

      <varlistentry id="collation-managing-create-icu-en-u-kf-upper-kr-grek-latn">
       <term><literal>CREATE COLLATION special (provider = icu, locale = 'en-u-kf-upper-kr-grek-latn');</literal></term>
       <listitem>
        <para>
         Combines both of the above options.
        </para>
       </listitem>
      </varlistentry>
     </variablelist>
   </sect3>

   <sect3 id="icu-tailoring-rules">
    <title>ICU Tailoring Rules</title>

    <para>
     If the options provided by the collation settings shown above

Title: ICU Collation Examples and Tailoring Rules
Summary
The section provides examples of creating collations using the ICU provider with various locale settings, such as German phone book collation, Emoji collation, and custom collations that sort Greek letters before Latin ones or upper-case letters before lower-case letters, and introduces the concept of ICU tailoring rules for further customization.