<!--
-$PostgreSQL: pgsql/doc/src/sgml/ref/alter_database.sgml,v 1.25 2010/04/03 07:22:56 petere Exp $
+doc/src/sgml/ref/alter_database.sgml
PostgreSQL documentation
-->
<refentry id="SQL-ALTERDATABASE">
+ <indexterm zone="sql-alterdatabase">
+ <primary>ALTER DATABASE</primary>
+ </indexterm>
+
<refmeta>
<refentrytitle>ALTER DATABASE</refentrytitle>
<manvolnum>7</manvolnum>
<refpurpose>change a database</refpurpose>
</refnamediv>
- <indexterm zone="sql-alterdatabase">
- <primary>ALTER DATABASE</primary>
- </indexterm>
-
<refsynopsisdiv>
<synopsis>
ALTER DATABASE <replaceable class="PARAMETER">name</replaceable> [ [ WITH ] <replaceable class="PARAMETER">option</replaceable> [ ... ] ]
<phrase>where <replaceable class="PARAMETER">option</replaceable> can be:</phrase>
+ IS_TEMPLATE <replaceable class="PARAMETER">istemplate</replaceable>
+ ALLOW_CONNECTIONS <replaceable class="PARAMETER">allowconn</replaceable>
CONNECTION LIMIT <replaceable class="PARAMETER">connlimit</replaceable>
ALTER DATABASE <replaceable class="PARAMETER">name</replaceable> RENAME TO <replaceable>new_name</replaceable>
<para>
The first form changes certain per-database settings. (See below for
details.) Only the database owner or a superuser can change these settings.
- </para>
+ </para>
<para>
The second form changes the name of the database. Only the database
</varlistentry>
<varlistentry>
+ <term><replaceable class="parameter">istemplate</replaceable></term>
+ <listitem>
+ <para>
+ If true, then this database can be cloned by any user with CREATEDB
+ privileges; if false, then only superusers or the owner of the
+ database can clone it.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><replaceable class="parameter">allowconn</replaceable></term>
+ <listitem>
+ <para>
+ If false then no one can connect to this database.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
<term><replaceable class="parameter">connlimit</replaceable></term>
<listitem>
<para>
to this database. -1 means no limit.
</para>
</listitem>
- </varlistentry>
+ </varlistentry>
<varlistentry>
<term><replaceable>new_name</replaceable></term>
The new default tablespace of the database.
</para>
</listitem>
- </varlistentry>
+ </varlistentry>
<varlistentry>
<term><replaceable>configuration_parameter</replaceable></term>
<programlisting>
ALTER DATABASE test SET enable_indexscan TO off;
-</programlisting>
- </para>
+</programlisting></para>
</refsect1>
<refsect1>
<title>Compatibility</title>
-
+
<para>
The <command>ALTER DATABASE</command> statement is a
<productname>PostgreSQL</productname> extension.