<command>initdb</command>
will only be accessible by the cluster owner by default. The
<option>--allow-group-access</option> option allows any user in the same
group as the cluster owner to read files in the cluster. This is useful
for performing backups as a non-privileged user.
</para>
<para>
<command>initdb</command> initializes the database cluster's default locale
and character set encoding. These can also be set separately for each
database when it is created. <command>initdb</command> determines those
settings for the template databases, which will serve as the default for
all other databases.
</para>
<para>
By default, <command>initdb</command> uses the locale provider
<literal>libc</literal> (see <xref linkend="locale-providers"/>). The
<literal>libc</literal> locale provider takes the locale settings from the
environment, and determines the encoding from the locale settings.
</para>
<para>
To choose a different locale for the cluster, use the option
<option>--locale</option>. There are also individual options
<option>--lc-*</option> and <option>--icu-locale</option> (see below) to
set values for the individual locale categories. Note that inconsistent
settings for different locale categories can give nonsensical results, so
this should be used with care.
</para>
<para>
Alternatively, <command>initdb</command> can use the ICU library to provide
locale services by specifying <literal>--locale-provider=icu</literal>. The
server must be built with ICU support. To choose the specific ICU locale ID
to apply, use the option <option>--icu-locale</option>. Note that for
implementation reasons and to support legacy code,
<command>initdb</command> will still select and initialize libc locale
settings when the ICU locale provider is used.
</para>
<para>
When <command>initdb</command> runs, it will print out the locale settings
it has chosen. If you have complex requirements or specified multiple
options, it is advisable to check that the result matches what was
intended.
</para>
<para>
More details about locale settings can be found in <xref
linkend="locale"/>.
</para>
<para>
To alter the default encoding, use the <option>--encoding</option>.
More details can be found in <xref linkend="multibyte"/>.
</para>
</refsect1>
<refsect1>
<title>Options</title>
<para>
<variablelist>
<varlistentry id="app-initdb-option-auth">
<term><option>-A <replaceable class="parameter">authmethod</replaceable></option></term>
<term><option>--auth=<replaceable class="parameter">authmethod</replaceable></option></term>
<listitem>
<para>
This option specifies the default authentication method for local
users used in <filename>pg_hba.conf</filename> (<literal>host</literal>
and <literal>local</literal> lines). See <xref linkend="auth-pg-hba-conf"/>
for an overview of valid values.
</para>
<para>
<command>initdb</command> will
prepopulate <filename>pg_hba.conf</filename> entries using the
specified authentication method for non-replication as well as
replication connections.
</para>
<para>
Do not use <literal>trust</literal> unless you trust all local users on your
system. <literal>trust</literal> is the default for ease of installation.
</para>
</listitem>
</varlistentry>
<varlistentry id="app-initdb-option-auth-host">
<term><option>--auth-host=<replaceable class="parameter">authmethod</replaceable></option></term>
<listitem>
<para>
This option specifies the authentication method for local users via
TCP/IP connections used in <filename>pg_hba.conf</filename>
(<literal>host</literal> lines).
</para>
</listitem>
</varlistentry>
<varlistentry id="app-initdb-option-auth-local">