Skip to content

Commit 37e5535

Browse files
committed
Add mention of init -W flag for security.
1 parent 220d006 commit 37e5535

File tree

1 file changed

+31
-18
lines changed

1 file changed

+31
-18
lines changed

doc/src/sgml/runtime.sgml

Lines changed: 31 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$Header: /cvsroot/pgsql/doc/src/sgml/runtime.sgml,v 1.97 2001/11/21 06:09:45 thomas Exp $
2+
$Header: /cvsroot/pgsql/doc/src/sgml/runtime.sgml,v 1.98 2001/11/28 00:13:30 momjian Exp $
33
-->
44

55
<Chapter Id="runtime">
@@ -51,28 +51,28 @@ $Header: /cvsroot/pgsql/doc/src/sgml/runtime.sgml,v 1.97 2001/11/21 06:09:45 tho
5151

5252
<para>
5353
Before you can do anything, you must initialize a database storage
54-
area on disk. We call this a <firstterm>database
55-
cluster</firstterm>. (<acronym>SQL</acronym> speaks of a catalog
56-
cluster instead.) A database cluster is a collection of databases
57-
that will be accessible through a single instance of a running
58-
database server. After initialization, a database cluster will
59-
contain one database named <literal>template1</literal>. As the
60-
name suggests, this will be used as a template for any subsequently
61-
created database; it should not be used for actual work.
54+
area on disk. We call this a <firstterm>database cluster</firstterm>.
55+
(<acronym>SQL</acronym> speaks of a catalog cluster instead.) A
56+
database cluster is a collection of databases that will be accessible
57+
through a single instance of a running database server. After
58+
initialization, a database cluster will contain one database named
59+
<literal>template1</literal>. As the name suggests, this will be used
60+
as a template for any subsequently created database; it should not be
61+
used for actual work.
6262
</para>
6363

6464
<para>
6565
In file system terms, a database cluster will be a single directory
66-
under which all data will be stored. We call this the
67-
<firstterm>data directory</firstterm> or <firstterm>data
68-
area</firstterm>. It is completely up to you where you choose to
69-
store your data, there is no default, although locations such as
66+
under which all data will be stored. We call this the <firstterm>data
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
69+
default, although locations such as
7070
<filename>/usr/local/pgsql/data</filename> or
71-
<filename>/var/lib/pgsql/data</filename> are popular. To initialize
72-
a database cluster, use the command <command>initdb</command>,
73-
which is installed with <productname>PostgreSQL</productname>. The
74-
desired file system location of your database system is indicated
75-
by the <option>-D</option> option, for example
71+
<filename>/var/lib/pgsql/data</filename> are popular. To initialize a
72+
database cluster, use the command <command>initdb</command>, which is
73+
installed with <productname>PostgreSQL</productname>. The desired
74+
file system location of your database system is indicated by the
75+
<option>-D</option> option, for example
7676
<screen>
7777
&gt; <userinput>initdb -D /usr/local/pgsql/data</userinput>
7878
</screen>
@@ -118,6 +118,19 @@ postgres&gt; <userinput>initdb -D /usr/local/pgsql/data</userinput>
118118
permissions from everyone but the <productname>PostgreSQL</productname> user account.
119119
</para>
120120

121+
<para>
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 to become the
125+
superuser and connect to the database. If you don't trust your local
126+
users, we recommend you use the <command>initdb</command> option
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.)
132+
</para>
133+
121134
<para>
122135
<indexterm><primary>LC_COLLATE</></>
123136
One surprise you might encounter while running <command>initdb</command> is

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy