<term><replaceable class="parameter">istemplate</replaceable></term>
<listitem>
<para>
If true, then this database can be cloned by any user with <literal>CREATEDB</literal>
privileges; if false (the default), then only superusers or the owner
of the database can clone it.
</para>
</listitem>
</varlistentry>
<varlistentry id="create-database-oid">
<term><replaceable class="parameter">oid</replaceable></term>
<listitem>
<para>
The object identifier to be used for the new database. If this
parameter is not specified, <productname>PostgreSQL</productname>
will choose a suitable OID automatically. This parameter is primarily
intended for internal use by <application>pg_upgrade</application>,
and only <application>pg_upgrade</application> can specify a value
less than 16384.
</para>
</listitem>
</varlistentry>
</variablelist>
<para>
Optional parameters can be written in any order, not only the order
illustrated above.
</para>
</refsect1>
<refsect1>
<title>Notes</title>
<para>
<command>CREATE DATABASE</command> cannot be executed inside a transaction
block.
</para>
<para>
Errors along the line of <quote>could not initialize database directory</quote>
are most likely related to insufficient permissions on the data
directory, a full disk, or other file system problems.
</para>
<para>
Use <link linkend="sql-dropdatabase"><command>DROP DATABASE</command></link> to remove a database.
</para>
<para>
The program <xref linkend="app-createdb"/> is a
wrapper program around this command, provided for convenience.
</para>
<para>
Database-level configuration parameters (set via <link
linkend="sql-alterdatabase"><command>ALTER DATABASE</command></link>) and database-level permissions (set via
<link linkend="sql-grant"><command>GRANT</command></link>) are not copied from the template database.
</para>
<para>
Although it is possible to copy a database other than <literal>template1</literal>
by specifying its name as the template, this is not (yet) intended as
a general-purpose <quote><command>COPY DATABASE</command></quote> facility.
The principal limitation is that no other sessions can be connected to
the template database while it is being copied. <command>CREATE
DATABASE</command> will fail if any other connection exists when it starts;
otherwise, new connections to the template database are locked out
until <command>CREATE DATABASE</command> completes.
See <xref linkend="manage-ag-templatedbs"/> for more information.
</para>
<para>
The character set encoding specified for the new database must be
compatible with the chosen locale settings (<literal>LC_COLLATE</literal> and
<literal>LC_CTYPE</literal>). If the locale is <literal>C</literal> (or equivalently
<literal>POSIX</literal>), then all encodings are allowed, but for other
locale settings there is only one encoding that will work properly.
(On Windows, however, UTF-8 encoding can be used with any locale.)
<command>CREATE DATABASE</command> will allow superusers to specify
<literal>SQL_ASCII</literal> encoding regardless