2 $Header: /cvsroot/pgsql/doc/src/sgml/ref/alter_database.sgml,v 1.2 2002/04/23 02:07:15 tgl Exp $
3 PostgreSQL documentation
6 <refentry id="SQL-ALTERDATABASE">
8 <refentrytitle id="sql-alterdatabase-title">ALTER DATABASE</refentrytitle>
9 <refmiscinfo>SQL - Language Statements</refmiscinfo>
13 <refname>ALTER DATABASE</refname>
14 <refpurpose>change a database</refpurpose>
19 ALTER DATABASE <replaceable class="PARAMETER">name</replaceable> SET <replaceable>variable</replaceable> { TO | = } { <replaceable>value</replaceable> | DEFAULT }
20 ALTER DATABASE <replaceable class="PARAMETER">name</replaceable> RESET <replaceable>variable</replaceable>
25 <title>Description</title>
28 <command>ALTER DATABASE</command> is used to change the session
29 default of a run-time configuration variable for a
30 <productname>PostgreSQL</productname> database. Whenever a new
31 session is subsequently started in that database, <literal>SET
32 <replaceable>variable</replaceable> TO
33 <replaceable>value</replaceable></literal> is effectively executed
34 before the start of the session. The database-specific default
35 overrides whatever setting is present in <filename>postgresql.conf</>
36 or has been received from the postmaster.
40 Only a superuser or the database owner can change the session defaults for a
45 <title>Parameters</title>
50 <term><replaceable class="PARAMETER">name</replaceable></term>
53 The name of the database whose session defaults are to be altered.
59 <term><replaceable>variable</replaceable></term>
60 <term><replaceable>value</replaceable></term>
63 Set the session default for this database of the specified
64 configuration variable to the given value. If
65 <replaceable>value</replaceable> is <literal>DEFAULT</literal>
66 or, equivalently, <literal>RESET</literal> is used, the
67 database-specific variable setting is removed and the default
68 setting will be inherited in new sessions. Use <literal>RESET
69 ALL</literal> to clear all settings.
73 See <xref linkend="sql-set" endterm="sql-set-title"> and the
74 <citetitle>Administrator's Guide</citetitle> for more
75 information about allowed variable names and values.
85 <title>Diagnostics</title>
90 <term><computeroutput>ALTER DATABASE</computeroutput></term>
93 Message returned if the alteration was successful.
99 <term><computeroutput>ERROR: database "dbname" does not exist</computeroutput></term>
102 Error message returned if the specified database is not known
115 Using <xref linkend="sql-alteruser" endterm="sql-alteruser-title">,
116 it is also possible to tie a session default to a specific user
117 rather than a database. User-specific settings override database-specific
118 ones if there is a conflict.
123 <title>Examples</title>
126 To disable index scans by default in the database
127 <literal>test</literal>:
130 ALTER DATABASE test SET enable_indexscan TO off;
136 <title>Compatibility</title>
139 The <command>ALTER DATABASE</command> statement is a
140 <productname>PostgreSQL</productname> extension.
145 <title>See Also</title>
147 <simplelist type="inline">
148 <member><xref linkend="sql-alteruser" endterm="sql-alteruser-title"></member>
149 <member><xref linkend="sql-createdatabase" endterm="sql-createdatabase-title"></member>
150 <member><xref linkend="sql-dropdatabase" endterm="sql-dropdatabase-title"></member>
151 <member><xref linkend="sql-set" endterm="sql-set-title"></member>
156 <!-- Keep this comment at the end of the file
161 sgml-minimize-attributes:nil
162 sgml-always-quote-attributes:t
165 sgml-parent-document:nil
166 sgml-default-dtd-file:"../reference.ced"
167 sgml-exposed-tags:nil
168 sgml-local-catalogs:"/usr/lib/sgml/catalog"
169 sgml-local-ecat-files:nil