]> granicus.if.org Git - postgresql/blobdiff - doc/src/sgml/ref/alter_database.sgml
Allow CREATE/ALTER DATABASE to manipulate datistemplate and datallowconn.
[postgresql] / doc / src / sgml / ref / alter_database.sgml
index f150fbb7556509b973675ee0e9fcf92300a39972..3724c05e2c0cfd6c1128094d9545747f8a75970c 100644 (file)
@@ -1,9 +1,13 @@
 <!--
-$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>
@@ -15,16 +19,14 @@ PostgreSQL documentation
   <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>
@@ -51,7 +53,7 @@ ALTER DATABASE <replaceable class="PARAMETER">name</replaceable> RESET ALL
   <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
@@ -107,6 +109,26 @@ ALTER DATABASE <replaceable class="PARAMETER">name</replaceable> RESET ALL
      </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>
@@ -114,7 +136,7 @@ ALTER DATABASE <replaceable class="PARAMETER">name</replaceable> RESET ALL
         to this database.  -1 means no limit.
        </para>
       </listitem>
-     </varlistentry> 
+     </varlistentry>
 
    <varlistentry>
     <term><replaceable>new_name</replaceable></term>
@@ -141,7 +163,7 @@ ALTER DATABASE <replaceable class="PARAMETER">name</replaceable> RESET ALL
       The new default tablespace of the database.
      </para>
     </listitem>
-   </varlistentry> 
+   </varlistentry>
 
      <varlistentry>
       <term><replaceable>configuration_parameter</replaceable></term>
@@ -190,13 +212,12 @@ ALTER DATABASE <replaceable class="PARAMETER">name</replaceable> RESET ALL
 
 <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.