11<!--
2- $Header: /cvsroot/pgsql/doc/src/sgml/ref/initdb.sgml,v 1.14 2000/12/25 23:15:26 petere Exp $
2+ $Header: /cvsroot/pgsql/doc/src/sgml/ref/initdb.sgml,v 1.15 2001/01/20 22:09:24 tgl Exp $
33Postgres documentation
44-->
55
@@ -41,7 +41,6 @@ Postgres documentation
4141 <arg>-L <replaceable>directory</replaceable></arg>
4242 <group><arg>--noclean</arg><arg>-n</arg></group>
4343 <group><arg>--debug</arg><arg>-d</arg></group>
44- <group><arg>--template</arg><arg>-t</arg></group>
4544 </cmdsynopsis>
4645 </refsynopsisdiv>
4746
@@ -58,17 +57,18 @@ Postgres documentation
5857 <para>
5958 Creating a database system consists of creating the directories in which
6059 the database data will live, generating the shared catalog tables
61- (tables thatdo not belong to any particular database), and
62- creating the <literal>template1</literal>
60+ (tables thatbelong to the whole cluster rather than to any particular
61+ database), and creating the <literal>template1</literal>
6362 database. When you create a new database, everything in the
6463 <literal>template1</literal> database is copied.
6564 It contains catalog tables filled in for things like the
6665 built-in types.
6766 </para>
6867
6968 <para>
70- You must not execute <application>initdb</application> as root. This is
71- because you cannot run the database server as root either, but the
69+ You must not execute <application>initdb</application> as root; it must
70+ be run by the Unix user account that will run the database server.
71+ This is because you cannot run the database server as root either, but the
7272 server needs to have access to the files <application>initdb</application>
7373 creates. Furthermore, during the initialization phase, when there are no
7474 users and no access controls installed, <productname>Postgres</productname>
@@ -78,10 +78,14 @@ Postgres documentation
7878 </para>
7979
8080 <para>
81- Although <application>initdb</application> will attempt to create the respective
82- data directory, chances are that it won't have the permission to do so. Thus
83- it is a good idea to create the data directory before running <application>initdb</application>
84- <emphasis>and</emphasis> to hand over the ownership of it to the database superuser.
81+ Although <application>initdb</application> will attempt to create the
82+ specified data directory, often it won't have permission to do so,
83+ since the parent of the desired data directory is often a root-owned
84+ directory. To set up an arrangement like this, create an empty data
85+ directory as root, then use <application>chown</application> to hand over
86+ ownership of that directory to the database user account, then
87+ <application>su</application> to become the database user, and
88+ finally run <application>initdb</application> as the database user.
8589 </para>
8690
8791 <refsect2>
@@ -96,7 +100,7 @@ Postgres documentation
96100 <para>
97101 This option specifies where in the file system the database
98102 should be stored. This is the only information required by
99- <application>initdb</application>, but you can avoid it by
103+ <application>initdb</application>, but you can avoidwriting it by
100104 setting the <envar>PGDATA</envar> environment variable, which
101105 can be convenient since the database server
102106 (<filename>postmaster</filename>) can find the database
@@ -125,7 +129,7 @@ Postgres documentation
125129 <listitem>
126130 <para>
127131 Makes <application>initdb</application> prompt for a password
128- of the database superuser. If you don't plan on using password
132+ to give the database superuser. If you don't plan on using password
129133 authentication, this is not important. Otherwise you won't be
130134 able to use password authentication until you have a password
131135 set up.
@@ -166,37 +170,15 @@ Postgres documentation
166170 </listitem>
167171 </varlistentry>
168172
169- <varlistentry>
170- <term>--template</term>
171- <term>-t</term>
172- <listitem>
173- <para>
174- Replace the <literal>template1</literal>
175- database in an existing database system, and don't touch anything else.
176- This is useful when you need to upgrade your <literal>template1</literal>
177- database using <application>initdb</application>
178- from a newer release of <productname>Postgres</productname>,
179- or when your <literal>template1</literal>
180- database has become corrupted by some system problem. Normally the
181- contents of <literal>template1</literal>
182- remain constant throughout the life of the database system. You can't
183- destroy anything by running <application>initdb</application>
184- with the
185- <option>--template</option>
186- option.
187- </para>
188- </listitem>
189- </varlistentry>
190-
191173 <varlistentry>
192174 <term>--noclean</term>
193175 <term>-n</term>
194176 <listitem>
195177 <para>
196178By default, when <application>initdb</application>
197179determines that an error prevented it from completely creating the database
198- system, it removes any files it may have created beforedetermining
199- that it can't finish the job. This option inhibitsany tidying-up and is
180+ system, it removes any files it may have created beforediscovering
181+ that it can't finish the job. This option inhibits tidying-up and is
200182thus useful for debugging.
201183 </para>
202184 </listitem>
@@ -211,7 +193,7 @@ Postgres documentation
211193 messages of lesser interest for the general public.
212194The bootstrap backend is the program <application>initdb</application>
213195uses to create the catalog tables. This option generates a tremendous
214- amount of output.
196+ amount ofextremely boring output.
215197 </para>
216198 </listitem>
217199 </varlistentry>