2 $Header: /cvsroot/pgsql/doc/src/sgml/ref/alter_database.sgml,v 1.3 2002/05/17 01:19:16 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, the specified
32 value becomes the session default value.
33 The database-specific default
34 overrides whatever setting is present in <filename>postgresql.conf</>
35 or has been received from the postmaster.
39 Only a superuser or the database owner can change the session defaults for a
44 <title>Parameters</title>
49 <term><replaceable class="PARAMETER">name</replaceable></term>
52 The name of the database whose session defaults are to be altered.
58 <term><replaceable>variable</replaceable></term>
59 <term><replaceable>value</replaceable></term>
62 Set the session default for this database of the specified
63 configuration variable to the given value. If
64 <replaceable>value</replaceable> is <literal>DEFAULT</literal>
65 or, equivalently, <literal>RESET</literal> is used, the
66 database-specific variable setting is removed and the system-wide
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