head	1.25;
access;
symbols
	REL9_0_0:1.25
	REL9_1_ALPHA1:1.25
	REL9_0_RC1:1.25
	REL9_0_BETA4:1.25
	REL9_0_STABLE:1.25.0.2
	REL9_0_BETA3:1.25
	REL9_0_BETA2:1.25
	REL7_4_29:1.10
	REL8_0_25:1.15
	REL8_1_21:1.17
	REL8_2_17:1.19
	REL8_3_11:1.20
	REL8_4_4:1.22
	REL9_0_BETA1:1.25
	REL9_0_ALPHA5_BRANCH:1.24.0.8
	REL9_0_ALPHA5:1.24
	REL7_4_28:1.10
	REL8_0_24:1.15
	REL8_1_20:1.17
	REL8_2_16:1.19
	REL8_3_10:1.20
	REL8_4_3:1.22
	REL9_0_ALPHA4:1.24
	REL9_0_ALPHA4_BRANCH:1.24.0.6
	REL8_5_ALPHA3:1.24
	REL8_5_ALPHA3_BRANCH:1.24.0.4
	REL7_4_27:1.10
	REL8_0_23:1.15
	REL8_1_19:1.17
	REL8_2_15:1.19
	REL8_3_9:1.20
	REL8_4_2:1.22
	REL8_5_ALPHA2:1.24
	REL8_5_ALPHA2_BRANCH:1.24.0.2
	REL7_4_26:1.10
	REL8_0_22:1.15
	REL8_1_18:1.17
	REL8_2_14:1.19
	REL8_3_8:1.20
	REL8_4_1:1.22
	REL8_5_ALPHA1:1.22
	REL8_5_ALPHA1_BRANCH:1.22.0.4
	REL8_4_STABLE:1.22.0.2
	REL8_4_0:1.22
	REL8_4_RC2:1.22
	REL8_4_RC1:1.22
	REL8_4_BETA2:1.22
	REL8_4_BETA1:1.22
	REL7_4_25:1.10
	REL8_0_21:1.15
	REL8_1_17:1.17
	REL8_2_13:1.19
	REL8_3_7:1.20
	REL7_4_24:1.10
	REL8_0_20:1.15
	REL8_1_16:1.17
	REL8_2_12:1.19
	REL8_3_6:1.20
	REL7_4_23:1.10
	REL8_0_19:1.15
	REL8_1_15:1.17
	REL8_2_11:1.19
	REL8_3_5:1.20
	REL7_4_22:1.10
	REL8_0_18:1.15
	REL8_1_14:1.17
	REL8_2_10:1.19
	REL8_3_4:1.20
	REL7_4_21:1.10
	REL8_0_17:1.15
	REL8_1_13:1.17
	REL8_2_9:1.19
	REL8_3_3:1.20
	REL7_4_20:1.10
	REL8_0_16:1.15
	REL8_1_12:1.17
	REL8_2_8:1.19
	REL8_3_2:1.20
	REL8_2_7:1.19
	REL8_3_1:1.20
	REL8_3_STABLE:1.20.0.2
	REL8_3_0:1.20
	REL8_3_RC2:1.20
	REL7_3_21:1.3
	REL7_4_19:1.10
	REL8_0_15:1.15
	REL8_1_11:1.17
	REL8_2_6:1.19
	REL8_3_RC1:1.20
	REL8_3_BETA4:1.20
	REL8_3_BETA3:1.20
	REL8_3_BETA2:1.20
	REL8_3_BETA1:1.20
	REL7_3_20:1.3
	REL7_4_18:1.10
	REL8_0_14:1.15
	REL8_1_10:1.17
	REL8_2_5:1.19
	REL7_3_19:1.3
	REL7_4_17:1.10
	REL8_0_13:1.15
	REL8_1_9:1.17
	REL8_2_4:1.19
	REL8_0_12:1.15
	REL8_1_8:1.17
	REL8_2_3:1.19
	REL7_3_18:1.3
	REL7_4_16:1.10
	REL8_0_11:1.15
	REL8_1_7:1.17
	REL8_2_2:1.19
	REL8_0_10:1.15
	REL8_1_6:1.17
	REL8_2_1:1.19
	REL7_4_15:1.10
	REL7_3_17:1.3
	REL8_2_STABLE:1.19.0.2
	REL8_2_0:1.19
	REL8_2_RC1:1.19
	REL8_2_BETA3:1.19
	REL8_2_BETA2:1.19
	REL8_1_5:1.17
	REL8_0_9:1.15
	REL7_4_14:1.10
	REL7_3_16:1.3
	REL8_2_BETA1:1.19
	REL7_3_15:1.3
	REL7_4_13:1.10
	REL8_0_8:1.15
	REL8_1_4:1.17
	REL7_3_14:1.3
	REL7_4_12:1.10
	REL8_0_7:1.15
	REL8_1_3:1.17
	REL7_3_13:1.3
	REL7_4_11:1.10
	REL8_0_6:1.15
	REL8_1_2:1.17
	REL7_3_12:1.3
	REL7_4_10:1.10
	REL8_0_5:1.15
	REL8_1_1:1.17
	REL8_1_STABLE:1.17.0.2
	REL8_1_0:1.17
	REL8_1_0RC1:1.17
	REL8_1_0BETA4:1.17
	REL8_1_0BETA3:1.16
	REL7_3_11:1.3
	REL7_4_9:1.10
	REL8_0_4:1.15
	REL8_1_0BETA2:1.16
	REL8_1_0BETA1:1.16
	REL7_3_10:1.3
	REL7_4_8:1.10
	REL8_0_3:1.15
	REL8_0_2:1.15
	REL7_3_9:1.3
	REL7_4_7:1.10
	REL8_0_1:1.15
	REL8_0_STABLE:1.15.0.4
	REL8_0_0:1.15.0.2
	REL8_0_0RC5:1.15
	REL8_0_0RC4:1.15
	REL8_0_0RC3:1.13
	REL8_0_0RC2:1.13
	REL8_0_0RC1:1.13
	REL8_0_0BETA5:1.13
	REL8_0_0BETA4:1.13
	REL7_4_6:1.10
	REL7_3_8:1.3
	REL8_0_0BETA3:1.13
	REL8_0_0BETA2:1.13
	REL7_4_5:1.10
	REL7_3_7:1.3
	REL7_4_4:1.10
	REL8_0_0BETA1:1.13
	REL7_4_3:1.10
	REL7_4_2:1.10
	REL7_3_6:1.3
	REL7_4_1:1.10
	REL7_3_5:1.3
	REL7_4:1.10
	REL7_4_RC2:1.10
	REL7_4_STABLE:1.10.0.2
	REL7_4_RC1:1.10
	REL7_4_BETA5:1.10
	REL7_4_BETA4:1.10
	REL7_4_BETA3:1.9
	REL7_4_BETA2:1.7
	WIN32_DEV:1.7.0.2
	REL7_4_BETA1:1.7
	REL7_3_4:1.3
	REL7_3_2:1.3
	REL7_3_STABLE:1.3.0.2;
locks; strict;
comment	@# @;


1.25
date	2010.04.03.07.22.56;	author petere;	state Exp;
branches;
next	1.24;

1.24
date	2009.09.19.10.23.26;	author petere;	state Exp;
branches;
next	1.23;

1.23
date	2009.09.18.05.00.41;	author petere;	state Exp;
branches;
next	1.22;

1.22
date	2008.11.14.10.22.45;	author petere;	state Exp;
branches;
next	1.21;

1.21
date	2008.11.07.18.25.06;	author tgl;	state Exp;
branches;
next	1.20;

1.20
date	2007.09.03.18.46.29;	author tgl;	state Exp;
branches;
next	1.19;

1.19
date	2006.09.16.00.30.16;	author momjian;	state Exp;
branches;
next	1.18;

1.18
date	2006.06.18.15.38.36;	author petere;	state Exp;
branches;
next	1.17;

1.17
date	2005.10.13.22.44.51;	author tgl;	state Exp;
branches;
next	1.16;

1.16
date	2005.07.31.17.19.16;	author tgl;	state Exp;
branches;
next	1.15;

1.15
date	2005.01.05.14.22.39;	author petere;	state Exp;
branches;
next	1.14;

1.14
date	2005.01.04.00.39.53;	author tgl;	state Exp;
branches;
next	1.13;

1.13
date	2004.07.05.02.34.43;	author momjian;	state Exp;
branches;
next	1.12;

1.12
date	2004.05.26.13.56.42;	author momjian;	state Exp;
branches;
next	1.11;

1.11
date	2003.11.29.19.51.38;	author pgsql;	state Exp;
branches;
next	1.10;

1.10
date	2003.09.22.00.16.57;	author petere;	state Exp;
branches;
next	1.9;

1.9
date	2003.09.09.18.28.52;	author tgl;	state Exp;
branches;
next	1.8;

1.8
date	2003.08.31.17.32.21;	author petere;	state Exp;
branches;
next	1.7;

1.7
date	2003.06.27.14.45.25;	author petere;	state Exp;
branches
	1.7.2.1;
next	1.6;

1.6
date	2003.04.15.13.25.08;	author petere;	state Exp;
branches;
next	1.5;

1.5
date	2003.03.25.16.15.38;	author petere;	state Exp;
branches;
next	1.4;

1.4
date	2003.01.19.00.13.29;	author momjian;	state Exp;
branches;
next	1.3;

1.3
date	2002.05.17.01.19.16;	author tgl;	state Exp;
branches;
next	1.2;

1.2
date	2002.04.23.02.07.15;	author tgl;	state Exp;
branches;
next	1.1;

1.1
date	2002.03.01.22.45.07;	author petere;	state Exp;
branches;
next	;

1.7.2.1
date	2003.09.07.04.36.44;	author momjian;	state Exp;
branches;
next	;


desc
@@


1.25
log
@Remove unnecessary xref endterm attributes and title ids

The endterm attribute is mainly useful when the toolchain does not support
automatic link target text generation for a particular situation.  In  the
past, this was required by the man page tools for all reference page links,
but that is no longer the case, and it now actually gets in the way of
proper automatic link text generation.  The only remaining use cases are
currently xrefs to refsects.
@
text
@<!--
$PostgreSQL: pgsql/doc/src/sgml/ref/alter_database.sgml,v 1.24 2009/09/19 10:23:26 petere Exp $
PostgreSQL documentation
-->

<refentry id="SQL-ALTERDATABASE">
 <refmeta>
  <refentrytitle>ALTER DATABASE</refentrytitle>
  <manvolnum>7</manvolnum>
  <refmiscinfo>SQL - Language Statements</refmiscinfo>
 </refmeta>

 <refnamediv>
  <refname>ALTER DATABASE</refname>
  <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>

    CONNECTION LIMIT <replaceable class="PARAMETER">connlimit</replaceable>

ALTER DATABASE <replaceable class="PARAMETER">name</replaceable> RENAME TO <replaceable>new_name</replaceable>

ALTER DATABASE <replaceable class="PARAMETER">name</replaceable> OWNER TO <replaceable>new_owner</replaceable>

ALTER DATABASE <replaceable class="PARAMETER">name</replaceable> SET TABLESPACE <replaceable class="PARAMETER">new_tablespace</replaceable>

ALTER DATABASE <replaceable class="PARAMETER">name</replaceable> SET <replaceable>configuration_parameter</replaceable> { TO | = } { <replaceable>value</replaceable> | DEFAULT }
ALTER DATABASE <replaceable class="PARAMETER">name</replaceable> SET <replaceable>configuration_parameter</replaceable> FROM CURRENT
ALTER DATABASE <replaceable class="PARAMETER">name</replaceable> RESET <replaceable>configuration_parameter</replaceable>
ALTER DATABASE <replaceable class="PARAMETER">name</replaceable> RESET ALL
</synopsis>
 </refsynopsisdiv>

 <refsect1>
  <title>Description</title>

  <para>
   <command>ALTER DATABASE</command> changes the attributes
   of a database.
  </para>

  <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>
   The second form changes the name of the database.  Only the database
   owner or a superuser can rename a database; non-superuser owners must
   also have the
   <literal>CREATEDB</literal> privilege.  The current database cannot
   be renamed.  (Connect to a different database if you need to do
   that.)
  </para>

  <para>
   The third form changes the owner of the database.
   To alter the owner, you must own the database and also be a direct or
   indirect member of the new owning role, and you must have the
   <literal>CREATEDB</literal> privilege.
   (Note that superusers have all these privileges automatically.)
  </para>

  <para>
   The fourth form changes the default tablespace of the database.
   Only the database owner or a superuser can do this; you must also have
   create privilege for the new tablespace.
   This command physically moves any tables or indexes in the database's old
   default tablespace to the new tablespace.  Note that tables and indexes
   in non-default tablespaces are not affected.
  </para>

  <para>
   The remaining forms change the session default for a run-time
   configuration variable for a <productname>PostgreSQL</productname>
   database. Whenever a new session is subsequently started in that
   database, the specified value becomes the session default value.
   The database-specific default overrides whatever setting is present
   in <filename>postgresql.conf</> or has been received from the
   <command>postgres</command> command line.  Only the database
   owner or a superuser can change the session defaults for a
   database.  Certain variables cannot be set this way, or can only be
   set by a superuser.
  </para>
 </refsect1>

 <refsect1>
  <title>Parameters</title>

    <variablelist>
     <varlistentry>
      <term><replaceable class="PARAMETER">name</replaceable></term>
      <listitem>
       <para>
        The name of the database whose attributes are to be altered.
       </para>
      </listitem>
     </varlistentry>

     <varlistentry>
      <term><replaceable class="parameter">connlimit</replaceable></term>
      <listitem>
       <para>
        How many concurrent connections can be made
        to this database.  -1 means no limit.
       </para>
      </listitem>
     </varlistentry> 

   <varlistentry>
    <term><replaceable>new_name</replaceable></term>
    <listitem>
     <para>
      The new name of the database.
     </para>
    </listitem>
   </varlistentry>

   <varlistentry>
    <term><replaceable class="parameter">new_owner</replaceable></term>
    <listitem>
     <para>
      The new owner of the database.
     </para>
    </listitem>
   </varlistentry>

   <varlistentry>
    <term><replaceable class="parameter">new_tablespace</replaceable></term>
    <listitem>
     <para>
      The new default tablespace of the database.
     </para>
    </listitem>
   </varlistentry> 

     <varlistentry>
      <term><replaceable>configuration_parameter</replaceable></term>
      <term><replaceable>value</replaceable></term>
      <listitem>
       <para>
        Set this database's session default for the specified configuration
        parameter to the given value.  If
        <replaceable>value</replaceable> is <literal>DEFAULT</literal>
        or, equivalently, <literal>RESET</literal> is used, the
        database-specific setting is removed, so the system-wide default
        setting will be inherited in new sessions.  Use <literal>RESET
        ALL</literal> to clear all database-specific settings.
        <literal>SET FROM CURRENT</> saves the session's current value of
        the parameter as the database-specific value.
       </para>

       <para>
        See <xref linkend="sql-set"> and <xref linkend="runtime-config">
        for more information about allowed parameter names
        and values.
       </para>
      </listitem>
     </varlistentry>
  </variablelist>
 </refsect1>

 <refsect1>
  <title>Notes</title>

  <para>
   It is also possible to tie a session default to a specific role
   rather than to a database; see
   <xref linkend="sql-alterrole">.
   Role-specific settings override database-specific
   ones if there is a conflict.
  </para>
 </refsect1>

 <refsect1>
  <title>Examples</title>

  <para>
   To disable index scans by default in the database
   <literal>test</literal>:

<programlisting>
ALTER DATABASE test SET enable_indexscan TO off;
</programlisting>
  </para>
 </refsect1>

 <refsect1>
  <title>Compatibility</title>
    
  <para>
   The <command>ALTER DATABASE</command> statement is a
   <productname>PostgreSQL</productname> extension.
  </para>
 </refsect1>

 <refsect1>
  <title>See Also</title>

  <simplelist type="inline">
   <member><xref linkend="sql-createdatabase"></member>
   <member><xref linkend="sql-dropdatabase"></member>
   <member><xref linkend="sql-set"></member>
   <member><xref linkend="sql-createtablespace"></member>
  </simplelist>
 </refsect1>
</refentry>
@


1.24
log
@Make the placeholder naming in the synopses of the SQL help more consistent
@
text
@d2 1
a2 1
$PostgreSQL: pgsql/doc/src/sgml/ref/alter_database.sgml,v 1.23 2009/09/18 05:00:41 petere Exp $
d8 1
a8 1
  <refentrytitle id="sql-alterdatabase-title">ALTER DATABASE</refentrytitle>
d163 1
a163 1
        See <xref linkend="sql-set" endterm="sql-set-title"> and <xref linkend="runtime-config">
d178 1
a178 1
   <xref linkend="sql-alterrole" endterm="sql-alterrole-title">.
d210 4
a213 4
   <member><xref linkend="sql-createdatabase" endterm="sql-createdatabase-title"></member>
   <member><xref linkend="sql-dropdatabase" endterm="sql-dropdatabase-title"></member>
   <member><xref linkend="sql-set" endterm="sql-set-title"></member>
   <member><xref linkend="sql-createtablespace" endterm="sql-createtablespace-title"></member>
@


1.23
log
@Easier to translate psql help

Instead of requiring translators to translate the entire SQL command
synopses, change create_help.pl to only require them to translate the
placeholders, and paste those into the synopsis using a printf mechanism.
Make some small updates to the markup to make it easier to parse.

Note: This causes msgmerge of gettext 0.17 to segfault.  You will need
the patch from https://savannah.gnu.org/bugs/?27474 to make it work.
msgmerge usually only runs on babel.postgresql.org, however.
@
text
@d2 1
a2 1
$PostgreSQL: pgsql/doc/src/sgml/ref/alter_database.sgml,v 1.22 2008/11/14 10:22:45 petere Exp $
d30 1
a30 1
ALTER DATABASE <replaceable class="PARAMETER">name</replaceable> RENAME TO <replaceable>newname</replaceable>
d120 1
a120 1
    <term><replaceable>newname</replaceable></term>
@


1.22
log
@Set SQL man pages to be section 7 by default, and only transform them to
another section if required by the platform (instead of the old way of
building them in section "l" and always transforming them to the
platform-specific section).

This speeds up the installation on common platforms, and it avoids some
funny business with the man page tools and build process.
@
text
@d2 1
a2 1
$PostgreSQL: pgsql/doc/src/sgml/ref/alter_database.sgml,v 1.21 2008/11/07 18:25:06 tgl Exp $
d26 1
a26 1
where <replaceable class="PARAMETER">option</replaceable> can be:
@


1.21
log
@Implement ALTER DATABASE SET TABLESPACE to move a whole database (or at least
as much of it as lives in its default tablespace) to a new tablespace.

Guillaume Lelarge, with some help from Bernd Helmle and Tom Lane
@
text
@d2 1
a2 1
$PostgreSQL: pgsql/doc/src/sgml/ref/alter_database.sgml,v 1.20 2007/09/03 18:46:29 tgl Exp $
d9 1
@


1.20
log
@Support SET FROM CURRENT in CREATE/ALTER FUNCTION, ALTER DATABASE, ALTER ROLE.
(Actually, it works as a plain statement too, but I didn't document that
because it seems a bit useless.)  Unify VariableResetStmt with
VariableSetStmt, and clean up some ancient cruft in the representation of
same.
@
text
@d2 1
a2 1
$PostgreSQL: pgsql/doc/src/sgml/ref/alter_database.sgml,v 1.19 2006/09/16 00:30:16 momjian Exp $
d33 2
d73 9
d136 9
d212 1
@


1.19
log
@Remove emacs info from footer of SGML files.
@
text
@d2 1
a2 1
$PostgreSQL: pgsql/doc/src/sgml/ref/alter_database.sgml,v 1.18 2006/06/18 15:38:36 petere Exp $
a28 3
ALTER DATABASE <replaceable class="PARAMETER">name</replaceable> SET <replaceable>parameter</replaceable> { TO | = } { <replaceable>value</replaceable> | DEFAULT }
ALTER DATABASE <replaceable class="PARAMETER">name</replaceable> RESET <replaceable>parameter</replaceable>

d32 5
d54 1
a54 14
   The second and third forms change the session default for a run-time
   configuration variable for a <productname>PostgreSQL</productname>
   database. Whenever a new session is subsequently started in that
   database, the specified value becomes the session default value.
   The database-specific default overrides whatever setting is present
   in <filename>postgresql.conf</> or has been received from the
   <command>postgres</command> command line.  Only the database
   owner or a superuser can change the session defaults for a
   database.  Certain variables cannot be set this way, or can only be
   set by a superuser.
  </para>

  <para>
   The fourth form changes the name of the database.  Only the database
d63 1
a63 1
   The fifth form changes the owner of the database.
d69 13
d107 18
d126 1
a126 1
      <term><replaceable>parameter</replaceable></term>
d137 2
a147 18

   <varlistentry>
    <term><replaceable>newname</replaceable></term>
    <listitem>
     <para>
      The new name of the database.
     </para>
    </listitem>
   </varlistentry>

   <varlistentry>
    <term><replaceable class="parameter">new_owner</replaceable></term>
    <listitem>
     <para>
      The new owner of the database.
     </para>
    </listitem>
   </varlistentry>
d155 1
a155 1
   It is also possible to tie a session default to a specific user
d157 2
a158 2
   <xref linkend="sql-alteruser" endterm="sql-alteruser-title">.
   User-specific settings override database-specific
@


1.18
log
@Merge postmaster and postgres command into just postgres.  postmaster
symlink is kept for now for compatibility.  To call single-user mode, use
postgres --single.
@
text
@d2 1
a2 1
$PostgreSQL: pgsql/doc/src/sgml/ref/alter_database.sgml,v 1.17 2005/10/13 22:44:51 tgl Exp $
a190 17

<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:nil
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:"../reference.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:"/usr/lib/sgml/catalog"
sgml-local-ecat-files:nil
End:
-->
@


1.17
log
@Update documentation to reflect the new ALTER OWNER rules for all
affected types of objects.
@
text
@d2 1
a2 1
$PostgreSQL: pgsql/doc/src/sgml/ref/alter_database.sgml,v 1.16 2005/07/31 17:19:16 tgl Exp $
d58 1
a58 1
   <command>postmaster</command> command line.  Only the database
@


1.16
log
@Add per-user and per-database connection limit options.
This patch also includes preliminary update of pg_dumpall for roles.
Petr Jelinek, with review by Bruce Momjian and Tom Lane.
@
text
@d2 1
a2 1
$PostgreSQL: pgsql/doc/src/sgml/ref/alter_database.sgml,v 1.15 2005/01/05 14:22:39 petere Exp $
d74 5
a78 2
   The fifth form changes the owner of the database.  Only a superuser
   can change the database's owner.
@


1.15
log
@Revert cosmetic synopsis changes that break psql translations.
@
text
@d2 1
a2 1
$PostgreSQL: pgsql/doc/src/sgml/ref/alter_database.sgml,v 1.14 2005/01/04 00:39:53 tgl Exp $
d23 6
d47 6
a52 1
   The first two forms change the session default for a run-time
d65 1
a65 1
   The third form changes the name of the database.  Only the database
d74 1
a74 1
   The fourth form changes the owner of the database.  Only a superuser
d93 10
@


1.14
log
@More minor updates and copy-editing.
@
text
@d2 1
a2 1
$PostgreSQL: pgsql/doc/src/sgml/ref/alter_database.sgml,v 1.13 2004/07/05 02:34:43 momjian Exp $
d28 1
a28 1
ALTER DATABASE <replaceable class="PARAMETER">name</replaceable> OWNER TO <replaceable>newowner</replaceable>
d113 1
a113 1
    <term><replaceable class="parameter">newowner</replaceable></term>
@


1.13
log
@Fix paragraph mention in ALTER DATABASE manual page.

Christopher Kings-Lynne
@
text
@d2 1
a2 1
$PostgreSQL: pgsql-server/doc/src/sgml/ref/alter_database.sgml,v 1.12 2004/05/26 13:56:42 momjian Exp $
d28 1
a28 1
ALTER DATABASE <replaceable class="PARAMETER">name</replaceable> OWNER TO <replaceable>new_owner</replaceable>
d36 1
a36 1
   <command>ALTER DATABASE</command> is used to change the attributes
d41 1
a41 1
   The first two forms change the session default of a run-time
d49 2
a50 1
   database.
d55 2
a56 1
   owner can rename a database, and only if he has the
d76 1
a76 1
	The name of the database whose session defaults are to be altered.
d86 2
a87 2
        Set the session default for this database of the specified
        configuration parameter to the given value.  If
d90 1
a90 2
        database-specific variable setting is removed and the system-wide
	default
d92 1
a92 1
        ALL</literal> to clear all settings.
d111 9
d127 4
a130 3
   Using <xref linkend="sql-alteruser" endterm="sql-alteruser-title">,
   it is also possible to tie a session default to a specific user
   rather than a database.  User-specific settings override database-specific
a160 1
   <member><xref linkend="sql-alteruser" endterm="sql-alteruser-title"></member>
@


1.12
log
@This patch implement the TODO [ALTER DATABASE foo OWNER TO bar].
It was necessary to touch in grammar and create a new node to make home
to the new syntax. The command is also supported in E
CPG. Doc updates are attached too. Only superusers can change the owner
of the database. New owners don't need any aditional
privileges.

Euler Taveira de Oliveira
@
text
@d2 1
a2 1
$PostgreSQL: pgsql-server/doc/src/sgml/ref/alter_database.sgml,v 1.11 2003/11/29 19:51:38 pgsql Exp $
d26 2
a28 2

ALTER DATABASE <replaceable class="PARAMETER">name</replaceable> RENAME TO <replaceable>newname</replaceable>
@


1.11
log
@
$Header: -> $PostgreSQL Changes ...
@
text
@d2 1
a2 1
$PostgreSQL: /cvsroot/pgsql-server/doc/src/sgml/ref/alter_database.sgml,v 1.10 2003/09/22 00:16:57 petere Exp $
d26 2
d58 5
@


1.10
log
@Make the SQL command synopses appear less random.
@
text
@d2 1
a2 1
$Header: /cvsroot/pgsql-server/doc/src/sgml/ref/alter_database.sgml,v 1.9 2003/09/09 18:28:52 tgl Exp $
@


1.9
log
@Remove a bunch of content-free Diagnostics sections, as per previous
discussion.  (Still have some work to do editing the remainder.)
@
text
@d2 1
a2 1
$Header: /cvsroot/pgsql-server/doc/src/sgml/ref/alter_database.sgml,v 1.8 2003/08/31 17:32:21 petere Exp $
d23 2
a24 2
ALTER DATABASE <replaceable class="PARAMETER">name</replaceable> SET <replaceable>variable</replaceable> { TO | = } { <replaceable>value</replaceable> | DEFAULT }
ALTER DATABASE <replaceable class="PARAMETER">name</replaceable> RESET <replaceable>variable</replaceable>
d73 1
a73 1
      <term><replaceable>variable</replaceable></term>
d78 1
a78 1
        configuration variable to the given value.  If
d89 1
a89 1
        for more information about allowed variable names
@


1.8
log
@Add/edit index entries.
@
text
@d2 1
a2 1
$Header: /cvsroot/pgsql-server/doc/src/sgml/ref/alter_database.sgml,v 1.7 2003/06/27 14:45:25 petere Exp $
a103 25
 </refsect1>

 <refsect1>
  <title>Diagnostics</title>

   <variablelist>
    <varlistentry>
     <term><computeroutput>ALTER DATABASE</computeroutput></term>
     <listitem>
      <para>
       Message returned if the alteration was successful.
      </para>
     </listitem>
    </varlistentry>
     
    <varlistentry>
     <term><computeroutput>ERROR:  database "dbname" does not exist</computeroutput></term>
     <listitem>
      <para>
       Error message returned if the specified database is not known
       to the system.
      </para>
     </listitem>
    </varlistentry>
   </variablelist>
@


1.7
log
@First batch of object rename commands.
@
text
@d2 1
a2 1
$Header: /cvsroot/pgsql-server/doc/src/sgml/ref/alter_database.sgml,v 1.6 2003/04/15 13:25:08 petere Exp $
d16 4
@


1.7.2.1
log
@Update this branch to match CVS head, includes WIN32 improvements.
@
text
@d2 1
a2 1
$Header: /cvsroot/pgsql-server/doc/src/sgml/ref/alter_database.sgml,v 1.8 2003/08/31 17:32:21 petere Exp $
a15 4

 <indexterm zone="sql-alterdatabase">
  <primary>ALTER DATABASE</primary>
 </indexterm>
@


1.6
log
@Bring SQL ref pages to consistent format, part 1.
@
text
@d2 1
a2 1
$Header: /cvsroot/pgsql-server/doc/src/sgml/ref/alter_database.sgml,v 1.5 2003/03/25 16:15:38 petere Exp $
d21 2
d30 2
a31 8
   <command>ALTER DATABASE</command> is used to change the session
   default of a run-time configuration variable for a
   <productname>PostgreSQL</productname> database. Whenever a new
   session is subsequently started in that database, the specified
   value becomes the session default value.
   The database-specific default
   overrides whatever setting is present in <filename>postgresql.conf</>
   or has been received from the <command>postmaster</command> command line.
d35 8
a42 1
   Only the database owner or a superuser can change the session defaults for a
d45 8
d90 10
a99 1
    </variablelist>
@


1.5
log
@Merge documentation into one book.  (Build with "make html".)  Replace
vague cross-references with real links.
@
text
@d2 1
a2 1
$Header: /cvsroot/pgsql-server/doc/src/sgml/ref/alter_database.sgml,v 1.4 2003/01/19 00:13:29 momjian Exp $
d35 1
a35 1
   or has been received from the postmaster.
d39 1
a39 1
   Only a superuser or the database owner can change the session defaults for a
d42 1
d44 2
a45 2
  <refsect2>
   <title>Parameters</title>
a46 1
   <para>
a79 2
   </para>
  </refsect2>
a84 1
  <para>
a104 1
  </para>
@


1.4
log
@This patch includes a lot of minor cleanups to the SGML documentation,
including:

- replacing all the appropriate usages of <citetitle>PostgreSQL
...</citetitle> with &cite-user;, &cite-admin;, and so on

- fix an omission in the EXECUTE documentation

- add some more text to the EXPLAIN documentation

- improve the PL/PgSQL RETURN NEXT documentation (more work to do here)

- minor markup fixes


Neil Conway
@
text
@d2 1
a2 1
$Header: /cvsroot/pgsql-server/doc/src/sgml/ref/alter_database.sgml,v 1.3 2002/05/17 01:19:16 tgl Exp $
d73 2
a74 2
        See <xref linkend="sql-set" endterm="sql-set-title"> and the
        &cite-admin; for more information about allowed variable names
@


1.3
log
@Merge the last few variable.c configuration variables into the generic
GUC support.  It's now possible to set datestyle, timezone, and
client_encoding from postgresql.conf and per-database or per-user
settings.  Also, implement rollback of SET commands that occur in a
transaction that later fails.  Create a SET LOCAL var = value syntax
that sets the variable only for the duration of the current transaction.
All per previous discussions in pghackers.
@
text
@d2 1
a2 1
$Header: /cvsroot/pgsql/doc/src/sgml/ref/alter_database.sgml,v 1.2 2002/04/23 02:07:15 tgl Exp $
d74 2
a75 2
        <citetitle>Administrator's Guide</citetitle> for more
        information about allowed variable names and values.
@


1.2
log
@Update SQL-command reference pages for schema features.
@
text
@d2 1
a2 1
$Header: /cvsroot/pgsql/doc/src/sgml/ref/alter_database.sgml,v 1.1 2002/03/01 22:45:07 petere Exp $
d31 3
a33 4
   session is subsequently started in that database, <literal>SET
   <replaceable>variable</replaceable> TO
   <replaceable>value</replaceable></literal> is effectively executed
   before the start of the session.  The database-specific default
d66 2
a67 1
        database-specific variable setting is removed and the default
@


1.1
log
@User and database-specific session defaults for run-time configuration
variables.  New commands ALTER DATABASE ... SET and ALTER USER ... SET.
@
text
@d2 1
a2 1
$Header$
d31 1
a31 1
   session is subsequently started, <literal>SET
d34 3
a36 1
   before the start of the session.
d40 1
a40 2
   Only a database owner can change the session defaults for a
   database.  Superusers can change the session defaults of any
d117 2
a118 1
   rather than a database.
@
