@@ -89,10 +89,28 @@ PostgreSQL documentation
89
89
and character set encoding. These can also be set separately for each
90
90
database when it is created. <command>initdb</command> determines those
91
91
settings for the template databases, which will serve as the default for
92
- all other databases. By default, <command>initdb</command> uses the
93
- locale provider <literal>libc</literal>, takes the locale settings from
94
- the environment, and determines the encoding from the locale settings.
95
- This is almost always sufficient, unless there are special requirements.
92
+ all other databases.
93
+ </para>
94
+
95
+ <para>
96
+ By default, <command>initdb</command> uses the ICU library to provide
97
+ locale services if the server was built with ICU support; otherwise it uses
98
+ the <literal>libc</literal> locale provider (see <xref
99
+ linkend="locale-providers"/>). To choose the specific ICU locale ID to
100
+ apply, use the option <option>--icu-locale</option>. Note that for
101
+ implementation reasons and to support legacy code,
102
+ <command>initdb</command> will still select and initialize libc locale
103
+ settings when the ICU locale provider is used.
104
+ </para>
105
+
106
+ <para>
107
+ Alternatively, <command>initdb</command> can use the locale provider
108
+ <literal>libc</literal>. To select this option, specify
109
+ <literal>--locale-provider=libc</literal>, or build the server without ICU
110
+ support. The <literal>libc</literal> locale provider takes the locale
111
+ settings from the environment, and determines the encoding from the locale
112
+ settings. This is almost always sufficient, unless there are special
113
+ requirements.
96
114
</para>
97
115
98
116
<para>
@@ -103,17 +121,6 @@ PostgreSQL documentation
103
121
categories can give nonsensical results, so this should be used with care.
104
122
</para>
105
123
106
- <para>
107
- Alternatively, the ICU library can be used to provide locale services.
108
- (Again, this only sets the default for subsequently created databases.) To
109
- select this option, specify <literal>--locale-provider=icu</literal>.
110
- To choose the specific ICU locale ID to apply, use the option
111
- <option>--icu-locale</option>. Note that
112
- for implementation reasons and to support legacy code,
113
- <command>initdb</command> will still select and initialize libc locale
114
- settings when the ICU locale provider is used.
115
- </para>
116
-
117
124
<para>
118
125
When <command>initdb</command> runs, it will print out the locale settings
119
126
it has chosen. If you have complex requirements or specified multiple
@@ -234,7 +241,13 @@ PostgreSQL documentation
234
241
<term><option>--icu-locale=<replaceable>locale</replaceable></option></term>
235
242
<listitem>
236
243
<para>
237
- Specifies the ICU locale ID, if the ICU locale provider is used.
244
+ Specifies the ICU locale when the ICU provider is used. Locale support
245
+ is described in <xref linkend="locale"/>.
246
+ </para>
247
+ <para>
248
+ If this option is not specified, the locale is inherited from the
249
+ environment in which <command>initdb</command> runs. The environment's
250
+ locale is matched to a similar ICU locale name, if possible.
238
251
</para>
239
252
</listitem>
240
253
</varlistentry>
@@ -307,10 +320,12 @@ PostgreSQL documentation
307
320
<term><option>--locale-provider={<literal>libc</literal>|<literal>icu</literal>}</option></term>
308
321
<listitem>
309
322
<para>
310
- This option sets the locale provider for databases created in the
311
- new cluster. It can be overridden in the <command>CREATE
323
+ This option sets the locale provider for databases created in the new
324
+ cluster. It can be overridden in the <command>CREATE
312
325
DATABASE</command> command when new databases are subsequently
313
- created. The default is <literal>libc</literal>.
326
+ created. The default is <literal>icu</literal> if the server was
327
+ built with ICU support; otherwise the default is
328
+ <literal>libc</literal> (see <xref linkend="locale-providers"/>).
314
329
</para>
315
330
</listitem>
316
331
</varlistentry>
0 commit comments