1
1
<!--
2
- $Header: /cvsroot/pgsql/doc/src/sgml/runtime.sgml,v 1.99 2001/11/28 20:49:10 petere Exp $
2
+ $Header: /cvsroot/pgsql/doc/src/sgml/runtime.sgml,v 1.100 2001/12/27 21:37:34 tgl Exp $
3
3
-->
4
4
5
5
<Chapter Id="runtime">
@@ -57,15 +57,15 @@ $Header: /cvsroot/pgsql/doc/src/sgml/runtime.sgml,v 1.99 2001/11/28 20:49:10 pet
57
57
through a single instance of a running database server. After
58
58
initialization, a database cluster will contain one database named
59
59
<literal>template1</literal>. As the name suggests, this will be used
60
- as a template forany subsequently createddatabase ; it should not be
60
+ as a template for subsequently createddatabases ; it should not be
61
61
used for actual work.
62
62
</para>
63
63
64
64
<para>
65
65
In file system terms, a database cluster will be a single directory
66
66
under which all data will be stored. We call this the <firstterm>data
67
67
directory</firstterm> or <firstterm>data area</firstterm>. It is
68
- completely up to you where you choose to store your data, there is no
68
+ completely up to you where you choose to store your data. There is no
69
69
default, although locations such as
70
70
<filename>/usr/local/pgsql/data</filename> or
71
71
<filename>/var/lib/pgsql/data</filename> are popular. To initialize a
@@ -76,7 +76,7 @@ $Header: /cvsroot/pgsql/doc/src/sgml/runtime.sgml,v 1.99 2001/11/28 20:49:10 pet
76
76
<screen>
77
77
<prompt>$</> <userinput>initdb -D /usr/local/pgsql/data</userinput>
78
78
</screen>
79
- Note that you must execute this command while being loggedin to
79
+ Note that you must execute this command while being loggedinto
80
80
the <productname>PostgreSQL</productname> user account, which is described in the previous
81
81
section.
82
82
</para>
@@ -113,22 +113,25 @@ postgres$ <userinput>initdb -D /usr/local/pgsql/data</userinput>
113
113
114
114
<para>
115
115
Because the data directory contains all the data stored in the
116
- database it is essential that it be well secured from unauthorized
116
+ database, it is essential that it be well secured from unauthorized
117
117
access. <command>initdb</command> therefore revokes access
118
118
permissions from everyone but the <productname>PostgreSQL</productname> user account.
119
119
</para>
120
120
121
121
<para>
122
122
However, while the directory contents are secure, the default
123
- <filename>pg_hba.conf</filename> authentication of
124
- <literal>trust</literal> allows any local user tobecome the
125
- superuser andconnect to the database. If you don't trustyour local
126
- users, we recommend you usethe <command>initdb</command> option
123
+ <filename>pg_hba.conf</filename> authenticationmethod of
124
+ <literal>trust</literal> allows any local user toconnect to the database
125
+ andeven become the database superuser . If you don't trustother local
126
+ users, we recommend you use <command>initdb</command>'s option
127
127
<option>-W</option> or <option>--pwprompt</option> to assign a
128
- password to the superuser and modify your
129
- <filename>pg_hba.conf</filename> accordingly. (Another option:
130
- Your operating system may support <literal>ident</literal> for
131
- local connections.)
128
+ password to the database superuser. After <command>initdb</command>,
129
+ modify <filename>pg_hba.conf</filename> to use <literal>md5</> or
130
+ <literal>password</>, instead of <literal>trust</>, authentication
131
+ <emphasis>before</> you first start the postmaster. (Other, possibly
132
+ more convenient approaches include using <literal>ident</literal>
133
+ authentication or filesystem permissions to restrict connections. See
134
+ <xref linkend="client-authentication"> for more information.)
132
135
</para>
133
136
134
137
<para>
@@ -172,7 +175,7 @@ NOTICE: Initializing database with en_US collation order.
172
175
$ <userinput>postmaster -D /usr/local/pgsql/data</userinput>
173
176
</screen>
174
177
which will leave the server running in the foreground. This must
175
- again be done while loggedin to the <productname>PostgreSQL</productname> user account. Without
178
+ again be done while loggedinto the <productname>PostgreSQL</productname> user account. Without
176
179
a <option>-D</option>, the server will try to use the data
177
180
directory in the environment variable <envar>PGDATA</envar>; if
178
181
neither of these works it will fail.
@@ -2287,7 +2290,7 @@ default:\
2287
2290
<para>
2288
2291
On <productname>Linux</productname>
2289
2292
<filename>/proc/sys/fs/file-max</filename> determines the
2290
- maximum number of files that the kernel willallocate . It can
2293
+ maximum number ofopen files that the kernel willsupport . It can
2291
2294
be changed by writing a different number into the file or by
2292
2295
adding an assignment in <filename>/etc/sysctl.conf</filename>.
2293
2296
The maximum limit of files per process is fixed at the time the
@@ -2315,6 +2318,16 @@ default:\
2315
2318
is perhaps what you want, but on dedicated servers you may want to
2316
2319
raise this limit.
2317
2320
</para>
2321
+
2322
+ <para>
2323
+ On the other side of the coin, some systems allow individual
2324
+ processes to open large numbers of files; if more than a few processes
2325
+ do so then the system-wide limit can easily be exceeded. If you find
2326
+ this happening, and don't want to alter the system-wide limit, you
2327
+ can set <productname>PostgreSQL</productname>'s
2328
+ <varname>max_files_per_process</varname> configuration parameter
2329
+ to limit its consumption of open files.
2330
+ </para>
2318
2331
</sect2>
2319
2332
2320
2333
</sect1>