diff options
author | Jeff Davis | 2023-03-10 18:51:24 +0000 |
---|---|---|
committer | Jeff Davis | 2023-03-10 18:51:24 +0000 |
commit | c45dc7ffbba2cb0bf180a0b9edadc22769143e7a (patch) | |
tree | 770647258cf331fae250613a00da2f85858bc020 /doc | |
parent | 3e623ebc7a22444ad3d15b36ffa3273c47283e18 (diff) |
initdb: derive encoding from locale for ICU; similar to libc.
Previously, the default encoding was derived from the locale when
using libc; while the default was always UTF-8 when using ICU. That
would throw an error when the locale was not compatible with UTF-8.
This commit causes initdb to derive the default encoding from the
locale for both providers. If --no-locale is specified (or if the
locale is C or POSIX), the default encoding will be UTF-8 for ICU
(because ICU does not support SQL_ASCII) and SQL_ASCII for libc.
Per buildfarm failure on system "hoverfly" related to commit
27b62377b4.
Discussion: https://postgr.es/m/d191d5841347301a8f1238f609471ddd957fc47e.camel%40j-davis.com
Diffstat (limited to 'doc')
-rw-r--r-- | doc/src/sgml/ref/initdb.sgml | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/doc/src/sgml/ref/initdb.sgml b/doc/src/sgml/ref/initdb.sgml index 05a9c2cf58..daebe75ee4 100644 --- a/doc/src/sgml/ref/initdb.sgml +++ b/doc/src/sgml/ref/initdb.sgml @@ -213,13 +213,19 @@ PostgreSQL documentation <term><option>--encoding=<replaceable class="parameter">encoding</replaceable></option></term> <listitem> <para> - Selects the encoding of the template databases. This will also - be the default encoding of any database you create later, - unless you override it then. The default is derived from the locale, - if the libc locale provider is used, or <literal>UTF8</literal> if the - ICU locale provider is used. The character sets supported by - the <productname>PostgreSQL</productname> server are described - in <xref linkend="multibyte-charset-supported"/>. + Selects the encoding of the template databases. This will also be the + default encoding of any database you create later, unless you override + it then. The character sets supported by the + <productname>PostgreSQL</productname> server are described in <xref + linkend="multibyte-charset-supported"/>. + </para> + <para> + By default, the template database encoding is derived from the + locale. If <xref linkend="app-initdb-option-no-locale"/> is specified + (or equivalently, if the locale is <literal>C</literal> or + <literal>POSIX</literal>), then the default is <literal>UTF8</literal> + for the ICU provider and <literal>SQL_ASCII</literal> for the + <literal>libc</literal> provider. </para> </listitem> </varlistentry> |