Commit f41bd4cb authored by Peter Eisentraut's avatar Peter Eisentraut

Expand collation documentation

Document better how to create custom collations and what locale strings
ICU accepts.  Explain the ICU examples in more detail.  Also update the
text on the CREATE COLLATION reference page a bit to take ICU more into
account.
parent 0703c197
This diff is collapsed.
......@@ -93,10 +93,7 @@ CREATE COLLATION [ IF NOT EXISTS ] <replaceable>name</replaceable> FROM <replace
<listitem>
<para>
Use the specified operating system locale for
the <symbol>LC_COLLATE</symbol> locale category. The locale
must be applicable to the current database encoding.
(See <xref linkend="sql-createdatabase"> for the precise
rules.)
the <symbol>LC_COLLATE</symbol> locale category.
</para>
</listitem>
</varlistentry>
......@@ -107,10 +104,7 @@ CREATE COLLATION [ IF NOT EXISTS ] <replaceable>name</replaceable> FROM <replace
<listitem>
<para>
Use the specified operating system locale for
the <symbol>LC_CTYPE</symbol> locale category. The locale
must be applicable to the current database encoding.
(See <xref linkend="sql-createdatabase"> for the precise
rules.)
the <symbol>LC_CTYPE</symbol> locale category.
</para>
</listitem>
</varlistentry>
......@@ -173,8 +167,13 @@ CREATE COLLATION [ IF NOT EXISTS ] <replaceable>name</replaceable> FROM <replace
</para>
<para>
See <xref linkend="collation"> for more information about collation
support in PostgreSQL.
See <xref linkend="collation-create"> for more information on how to create collations.
</para>
<para>
When using the <literal>libc</literal> collation provider, the locale must
be applicable to the current database encoding.
See <xref linkend="sql-createdatabase"> for the precise rules.
</para>
</refsect1>
......@@ -186,7 +185,14 @@ CREATE COLLATION [ IF NOT EXISTS ] <replaceable>name</replaceable> FROM <replace
<literal>fr_FR.utf8</literal>
(assuming the current database encoding is <literal>UTF8</literal>):
<programlisting>
CREATE COLLATION french (LOCALE = 'fr_FR.utf8');
CREATE COLLATION french (locale = 'fr_FR.utf8');
</programlisting>
</para>
<para>
To create a collation using the ICU provider using German phone book sort order:
<programlisting>
CREATE COLLATION german_phonebook (provider = icu, locale = 'de-u-co-phonebk');
</programlisting>
</para>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment