1
1
<!--
2
- $Header: /cvsroot/pgsql/doc/src/sgml/ref/Attic/initlocation.sgml,v 1.4 1999/07/22 15:09:12 thomas Exp $
2
+ $Header: /cvsroot/pgsql/doc/src/sgml/ref/Attic/initlocation.sgml,v 1.5 2000/01/18 00:03:34 petere Exp $
3
3
Postgres documentation
4
4
-->
5
5
@@ -15,17 +15,15 @@ Postgres documentation
15
15
<application>initlocation</application>
16
16
</refname>
17
17
<refpurpose>
18
- Create a secondary <productname>Postgres </productname> database storage area
18
+ Create a secondary <productname>PostgreSQL </productname> database storage area
19
19
</refpurpose>
20
20
</refnamediv>
21
21
<refsynopsisdiv>
22
22
<refsynopsisdivinfo>
23
- <date>1999-07-20 </date>
23
+ <date>2000-01-17 </date>
24
24
</refsynopsisdivinfo>
25
25
<synopsis>
26
- initlocation [ --location=<replaceable class="parameter">er">al</replaceable>ble> | -D <replaceable class="parameter">altdir</replaceable> ]
27
- [ --username=<replaceable class="parameter">name</replaceable> | -u <replaceable class="parameter">name</replaceable> ]
28
- [ <replaceable class="parameter">altdir</replaceable> ]
26
+ initlocation <replaceable class="parameter">directory</replaceable>
29
27
</synopsis>
30
28
31
29
<refsect2 id="R2-APP-INITLOCATION-1">
@@ -39,45 +37,14 @@ initlocation [ --location=<replaceable class="parameter">er">al</replaceable>ble
39
37
40
38
<variablelist>
41
39
<varlistentry>
42
- <term>--location=<replaceable class="parameter">altdir</replaceable></term>
43
- <term>-D <replaceable class="parameter">altdir</replaceable></term>
44
- <term><replaceable class="parameter">altdir</replaceable></term>
40
+ <term><replaceable class="parameter">directory</replaceable></term>
45
41
<listitem>
46
42
<para>
47
43
Where in your Unix filesystem do you want alternate databases to go?
48
- The top level directory is called the <envar>PGDATA</envar> directory, so you
49
- might want to point your first alternate location at
50
- <envar>PGDATA2</envar>.
51
44
</para>
52
45
</listitem>
53
46
</varlistentry>
54
47
55
- <varlistentry>
56
- <term>--username=<replaceable class="parameter">name</replaceable></term>
57
- <term>-u <replaceable class="parameter">name</replaceable></term>
58
- <term><envar>PGUSER</envar></term>
59
- <listitem>
60
- <para>
61
- Who will be the Unix filesystem owner of this database storage area?
62
- The
63
- <productname>Postgres</productname> superuser is a Unix user
64
- who owns all files that store the database
65
- system and also owns the postmaster and backend processes that access them.
66
- Usually, this is the user who should run <application>initlocation</application>
67
- and who will thus have ownership of the directories and files.
68
- </para>
69
- <note>
70
- <para>
71
- Only the Unix superuser can create a database system with a
72
- different user as the <productname>Postgres</productname> superuser.
73
- Specifying a user other than the <productname>Postgres</productname> superuser
74
- may lead to database security and data integrity problems. Refer to the
75
- <citetitle><productname>PostgreSQL</productname> Administrator's Guide</citetitle>
76
- for more information.
77
- </para>
78
- </note>
79
- </listitem>
80
- </varlistentry>
81
48
</variablelist>
82
49
</para>
83
50
</refsect2>
@@ -92,65 +59,6 @@ initlocation [ --location=<replaceable class="parameter">er">al</replaceable>ble
92
59
<para>
93
60
<application>initlocation</application> will create directories in
94
61
the specified place.
95
-
96
- <variablelist>
97
- <varlistentry>
98
- <term><computeroutput>
99
- We are initializing the database area with username postgres (uid=500).
100
- This user will own all the files and must also own the server process.
101
- Creating Postgres database system directory <replaceable class="parameter">altdir</replaceable>
102
- Creating Postgres database system directory <replaceable class="parameter">altdir</replaceable>
103
- </computeroutput></term>
104
- <listitem>
105
- <para>
106
- Successful completion.
107
- </para>
108
- </listitem>
109
- </varlistentry>
110
-
111
- <varlistentry>
112
- <term><computeroutput>
113
- We are initializing the database area with username postgres (uid=500).
114
- This user will own all the files and must also own the server process.
115
- Creating Postgres database system directory /usr/local/src/testlocation
116
- mkdir: cannot make directory `<replaceable class="parameter">altdir</replaceable>': Permission denied
117
- </computeroutput></term>
118
- <listitem>
119
- <para>
120
- You do not have filesystem permission to write to the specified directory area.
121
- </para>
122
- </listitem>
123
- </varlistentry>
124
-
125
- <varlistentry>
126
- <term><computeroutput>
127
- Valid username not given. You must specify the username for
128
- the Postgres superuser for the database system you are
129
- initializing, either with the --username option or by default
130
- to the USER environment variable.
131
- </computeroutput></term>
132
- <listitem>
133
- <para>
134
- The username which you have specified is not the
135
- <productname>Postgres</productname> superuser.
136
- </para>
137
- </listitem>
138
- </varlistentry>
139
-
140
- <varlistentry>
141
- <term><computeroutput>
142
- Can't tell what username to use. You don't have the USER
143
- environment variable set to your username and didn't specify the
144
- --username option
145
- </computeroutput></term>
146
- <listitem>
147
- <para>
148
- Specify the <option>--username</option> command line option.
149
- </para>
150
- </listitem>
151
- </varlistentry>
152
-
153
- </variablelist>
154
62
</para>
155
63
</refsect2>
156
64
</refsynopsisdiv>
@@ -164,41 +72,16 @@ environment variable set to your username and didn't specify the
164
72
</title>
165
73
<para>
166
74
<application>initlocation</application>
167
- creates a new <productname>Postgres</productname> secondary database storage area.
168
- A secondary storage area contains a required tree of directories with
169
- the correct file permissions on those directories.
170
- </para>
171
- <para>
172
- Creating a database storage area consists of creating the directories in which
173
- database data might live.
75
+ creates a new <productname>PostgreSQL</productname> secondary database storage area.
76
+ See the discussion under <xref linkend="SQL-CREATEDATABASE" endterm="SQL-CREATEDATABASE-title">
77
+ about how to manage and use secondary storage areas. If the argument does not contain
78
+ a slash and is not valid as a path, it is assumed to be an environment variable,
79
+ which is referenced. See the examples at the end.
174
80
</para>
175
81
<para>
176
- There are two kinds of arguments for <application>initlocation</application>.
177
-
178
- First, you can specify an environment variable (e.g. <envar>PGDATA2</envar>).
179
- This environment variable should be known to the backend for later use in
180
- <command>CREATE DATABASE/WITH LOCATION</command>
181
- or
182
- <command>createdb -D <replaceable class="parameter">altdir</replaceable></command>.
183
- However, <emphasis>the backend daemon must have this variable in it's
184
- environment</emphasis> for this to succeed.
185
-
186
- Second, you may be able to specify an explicit
187
- absolute path to the top directory of the storage area. However,this second
188
- option is possible only if explicitly enabled during the
189
- <productname>Postgres</productname> installation. It is usually disabled
190
- to alleviate security and data integrity concerns.
82
+ In order to use this command you must be logged in (using 'su', for example)
83
+ the database superuser.
191
84
</para>
192
- <note>
193
- <para>
194
- <productname>Postgres</productname> will add <filename>/base/</filename>
195
- to the specified path to create the storage area.
196
- </para>
197
- <para>
198
- The backend requires that any argument to <option>WITH LOCATION</option> which is
199
- in all uppercase and which has no path delimiters is an environment variable.
200
- </para>
201
- </note>
202
85
</refsect1>
203
86
204
87
<refsect1 id="R1-APP-INITLOCATION-2">
@@ -210,12 +93,19 @@ environment variable set to your username and didn't specify the
210
93
</title>
211
94
<para>
212
95
To create a database in an alternate location, using an environment variable:
96
+ <programlisting>
97
+ $ export PGDATA2=/opt/postgres/data
98
+ $ initlocation PGDATA2
99
+ $ createdb 'testdb' -D 'PGDATA2/testdb'
100
+ </programlisting>
101
+ </para>
213
102
214
- <programlisting>
215
- % setenv PGDATA2 /opt/postgres/data
216
- % initlocation PGDATA2
217
- % createdb -D PGDATA2
218
- </programlisting>
103
+ <para>
104
+ Alternatively, if you allow absolute paths you could write:
105
+ <programlisting>
106
+ $ initlocation /opt/postgres/data
107
+ $ createdb 'testdb' -D '/opt/postgres/data/testdb'
108
+ </programlisting>
219
109
</para>
220
110
</refsect1>
221
111
</refentry>
0 commit comments