11<!--
2- $Header: /cvsroot/pgsql/doc/src/sgml/ref/create_database.sgml,v 1.35 2003/08/31 17:32:22 petere Exp $
2+ $Header: /cvsroot/pgsql/doc/src/sgml/ref/create_database.sgml,v 1.36 2003/09/12 00:12:47 tgl Exp $
33PostgreSQL documentation
44-->
55
@@ -36,6 +36,12 @@ CREATE DATABASE <replaceable class="PARAMETER">name</replaceable>
3636 <productname>PostgreSQL</productname> database.
3737 </para>
3838
39+ <para>
40+ To create a database, you must be a superuser or have the special
41+ <literal>CREATEDB</> privilege.
42+ See <xref linkend="SQL-CREATEUSER" endterm="SQL-CREATEUSER-title">.
43+ </para>
44+
3945 <para>
4046 Normally, the creator becomes the owner of the new database.
4147 Superusers can create databases owned by other users using the
@@ -63,6 +69,8 @@ CREATE DATABASE <replaceable class="PARAMETER">name</replaceable>
6369 a leading slash
6470 (e.g., <filename>/usr/local/pgsql/data</filename>),
6571 are allowed as well.
72+ In either case, the final path name must be absolute and must not
73+ contain any single quotes.
6674 </para>
6775
6876 <para>
@@ -86,7 +94,7 @@ CREATE DATABASE <replaceable class="PARAMETER">name</replaceable>
8694 </refsect1>
8795
8896 <refsect1>
89- <title>Parameter </title>
97+ <title>Parameters </title>
9098
9199 <variablelist>
92100 <varlistentry>
@@ -147,78 +155,20 @@ CREATE DATABASE <replaceable class="PARAMETER">name</replaceable>
147155 </refsect1>
148156
149157 <refsect1>
150- <title>Diagnostics</title>
151-
152- <variablelist>
153- <varlistentry>
154- <term><computeroutput>CREATE DATABASE</computeroutput></term>
155- <listitem>
156- <para>
157- Message returned if the database was successfully created.
158- </para>
159- </listitem>
160- </varlistentry>
161-
162- <varlistentry>
163- <term><computeroutput>ERROR: user '<replaceable class="parameter">username</replaceable>' is not allowed to create/drop databases</computeroutput></term>
164- <listitem>
165- <para>
166- You must have the special <literal>CREATEDB</> privilege to create databases.
167- See <xref linkend="SQL-CREATEUSER" endterm="SQL-CREATEUSER-title">.
168- </para>
169- </listitem>
170- </varlistentry>
171-
172-
173- <varlistentry>
174- <term><computeroutput>ERROR: createdb: database "<replaceable class="parameter">name</replaceable>" already exists</computeroutput></term>
175- <listitem>
176- <para>
177- This occurs if a database with the specified name already
178- exists.
179- </para>
180- </listitem>
181- </varlistentry>
182-
183- <varlistentry>
184- <term><computeroutput>ERROR: database path may not contain single quotes</computeroutput></term>
185- <listitem>
186- <para>
187- The database location
188- <replaceable class="parameter">dbpath</replaceable> cannot contain
189- single quotes. This is required so that the shell commands that
190- create the database directory can execute safely.
191- </para>
192- </listitem>
193- </varlistentry>
194-
195- <varlistentry>
196- <term><computeroutput>ERROR: CREATE DATABASE: may not be called in a transaction block</computeroutput></term>
197- <listitem>
198- <para>
199- If you have an explicit transaction block in progress you cannot call
200- <command>CREATE DATABASE</command>. You must finish the transaction first.
201- </para>
202- </listitem>
203- </varlistentry>
204-
205- <varlistentry>
206- <term><computeroutput>ERROR: Unable to create database directory '<replaceable>path</replaceable>'.</computeroutput></term>
207- <term><computeroutput>ERROR: Could not initialize database directory.</computeroutput></term>
208- <listitem>
209- <para>
210- These are most likely related to insufficient permissions on the data
211- directory, a full disk, or other file system problems. The user under
212- which the database server is running must have access to the location.
213- </para>
214- </listitem>
215- </varlistentry>
158+ <title>Notes</title>
216159
217- </variablelist>
218- </refsect1>
160+ <para>
161+ <command>CREATE DATABASE</> cannot be executed inside a transaction
162+ block.
163+ </para>
219164
220- <refsect1>
221- <title>Notes</title>
165+ <para>
166+ Errors along the line of <quote>could not initialize database directory</>
167+ are most likely related to insufficient permissions on the data
168+ directory, a full disk, or other file system problems. When using an
169+ alternate location, the user under
170+ which the database server is running must have access to the location.
171+ </para>
222172
223173 <para>
224174 Use <xref linkend="SQL-DROPDATABASE" endterm="SQL-DROPDATABASE-title"> to remove a database.
@@ -231,7 +181,8 @@ CREATE DATABASE <replaceable class="PARAMETER">name</replaceable>
231181
232182 <para>
233183 There are security issues involved with using alternate database
234- locations specified with absolute path names. See <xref
184+ locations specified with absolute path names; this is why the feature
185+ is not enabled by default. See <xref
235186 linkend="manage-ag-alternate-locs"> for more information.
236187 </para>
237188