diff options
Diffstat (limited to 'doc/src/sgml/ref/alter_database.sgml')
-rw-r--r-- | doc/src/sgml/ref/alter_database.sgml | 86 |
1 files changed, 45 insertions, 41 deletions
diff --git a/doc/src/sgml/ref/alter_database.sgml b/doc/src/sgml/ref/alter_database.sgml index 8ddff97e029..d16cc2fdad1 100644 --- a/doc/src/sgml/ref/alter_database.sgml +++ b/doc/src/sgml/ref/alter_database.sgml @@ -1,5 +1,5 @@ <!-- -$PostgreSQL: pgsql/doc/src/sgml/ref/alter_database.sgml,v 1.19 2006/09/16 00:30:16 momjian Exp $ +$PostgreSQL: pgsql/doc/src/sgml/ref/alter_database.sgml,v 1.20 2007/09/03 18:46:29 tgl Exp $ PostgreSQL documentation --> @@ -26,12 +26,14 @@ where <replaceable class="PARAMETER">option</replaceable> can be: CONNECTION LIMIT <replaceable class="PARAMETER">connlimit</replaceable> -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> - ALTER DATABASE <replaceable class="PARAMETER">name</replaceable> RENAME TO <replaceable>newname</replaceable> ALTER DATABASE <replaceable class="PARAMETER">name</replaceable> OWNER TO <replaceable>new_owner</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> @@ -49,20 +51,7 @@ ALTER DATABASE <replaceable class="PARAMETER">name</replaceable> OWNER TO <repla </para> <para> - 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 + 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 @@ -71,12 +60,25 @@ ALTER DATABASE <replaceable class="PARAMETER">name</replaceable> OWNER TO <repla </para> <para> - The fifth form changes the owner of the database. + 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 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> @@ -102,8 +104,26 @@ ALTER DATABASE <replaceable class="PARAMETER">name</replaceable> OWNER TO <repla </listitem> </varlistentry> + <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> + <varlistentry> - <term><replaceable>parameter</replaceable></term> + <term><replaceable>configuration_parameter</replaceable></term> <term><replaceable>value</replaceable></term> <listitem> <para> @@ -114,6 +134,8 @@ ALTER DATABASE <replaceable class="PARAMETER">name</replaceable> OWNER TO <repla 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> @@ -123,24 +145,6 @@ ALTER DATABASE <replaceable class="PARAMETER">name</replaceable> OWNER TO <repla </para> </listitem> </varlistentry> - - <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> </variablelist> </refsect1> @@ -148,10 +152,10 @@ ALTER DATABASE <replaceable class="PARAMETER">name</replaceable> OWNER TO <repla <title>Notes</title> <para> - It is also possible to tie a session default to a specific user + It is also possible to tie a session default to a specific role rather than to a database; see - <xref linkend="sql-alteruser" endterm="sql-alteruser-title">. - User-specific settings override database-specific + <xref linkend="sql-alterrole" endterm="sql-alterrole-title">. + Role-specific settings override database-specific ones if there is a conflict. </para> </refsect1> |