Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf8aa366

Browse files
author
Thomas G. Lockhart
committed
Indent markup using emacs.
1 parent1def28f commitf8aa366

File tree

1 file changed

+162
-149
lines changed

1 file changed

+162
-149
lines changed

‎doc/src/sgml/manage.sgml

Lines changed: 162 additions & 149 deletions
Original file line numberDiff line numberDiff line change
@@ -1,174 +1,170 @@
1-
<Chapter Id="manage">
2-
<Title>Managing a Database</Title>
3-
4-
<Para>
5-
<Note>
6-
<Para>
7-
This section is currently a thinly disguised copy of the Tutorial. Needs to be augmented.
8-
- thomas 1998-01-12
9-
</Para>
10-
</Note>
11-
</Para>
12-
13-
<Para>
14-
Although the <FirstTerm>site administrator</FirstTerm> is responsible for overall management
15-
of the <ProductName>Postgres</ProductName> installation, some databases within the
16-
installation may be managed by another person,
17-
designated the <FirstTerm>database administrator</FirstTerm>.
18-
This assignment of responsibilities occurs when a database is created.
19-
A user may be assigned explicit privileges to create databases and/or to create new users.
20-
A user assigned both privileges can perform most administrative task
21-
within <ProductName>Postgres</ProductName>, but will
22-
not by default have the same operating system privileges as the site administrator.
23-
</Para>
24-
25-
<Para>
26-
The Database Administrator's Guide covers these topics in more detail.
27-
</Para>
28-
29-
<Sect1>
30-
<Title>Database Creation</Title>
31-
32-
<Para>
33-
Databases are created by the <Command>create database</Command> issued from
34-
within <ProductName>Postgres</ProductName>. <Application>createdb</Application> is a command-line
35-
utility provided to give the same functionality from outside <ProductName>Postgres</ProductName>.
36-
</Para>
37-
38-
<Para>
39-
The <ProductName>Postgres</ProductName> backend must be running for either method
40-
to succeed, and the user issuing the command must be the <ProductName>Postgres</ProductName>
41-
<FirstTerm>superuser</FirstTerm> or have been assigned database creation privileges by the
42-
superuser.
43-
</Para>
44-
45-
<Para>
46-
To create a new database named <Quote>mydb</Quote> from the command line, type
47-
<ProgramListing>
1+
<Chapter Id="manage">
2+
<Title>Managing a Database</Title>
3+
4+
<Note>
5+
<Para>
6+
This section is currently a thinly disguised copy of the
7+
Tutorial. Needs to be augmented.
8+
- thomas 1998-01-12
9+
</Para>
10+
</Note>
11+
12+
<Para>
13+
Although the <FirstTerm>site administrator</FirstTerm> is responsible for overall management
14+
of the <ProductName>Postgres</ProductName> installation, some databases within the
15+
installation may be managed by another person,
16+
designated the <FirstTerm>database administrator</FirstTerm>.
17+
This assignment of responsibilities occurs when a database is created.
18+
A user may be assigned explicit privileges to create databases and/or to create new users.
19+
A user assigned both privileges can perform most administrative task
20+
within <ProductName>Postgres</ProductName>, but will
21+
not by default have the same operating system privileges as the site administrator.
22+
</Para>
23+
24+
<Para>
25+
The Database Administrator's Guide covers these topics in more detail.
26+
</Para>
27+
28+
<Sect1>
29+
<Title>Database Creation</Title>
30+
31+
<Para>
32+
Databases are created by the <Command>create database</Command> issued from
33+
within <ProductName>Postgres</ProductName>. <Application>createdb</Application> is a command-line
34+
utility provided to give the same functionality from outside <ProductName>Postgres</ProductName>.
35+
</Para>
36+
37+
<Para>
38+
The <ProductName>Postgres</ProductName> backend must be running for either method
39+
to succeed, and the user issuing the command must be the <ProductName>Postgres</ProductName>
40+
<FirstTerm>superuser</FirstTerm> or have been assigned database creation privileges by the
41+
superuser.
42+
</Para>
43+
44+
<Para>
45+
To create a new database named <Quote>mydb</Quote> from the command line, type
46+
<ProgramListing>
4847
% createdb mydb
49-
</ProgramListing>
48+
</ProgramListing>
5049

51-
and to do the same from within <Application>psql</Application> type
52-
<ProgramListing>
50+
and to do the same from within <Application>psql</Application> type
51+
<ProgramListing>
5352
* CREATE DATABASE mydb;
54-
</ProgramListing>
55-
</Para>
53+
</ProgramListing>
54+
</Para>
5655

57-
<Para>
58-
If you do not have the privileges required to create a database, you will see
59-
the following:
60-
<ProgramListing>
56+
<Para>
57+
If you do not have the privileges required to create a database, you will see
58+
the following:
59+
<ProgramListing>
6160
% createdb mydb
6261
WARN:user "your username" is not allowed to create/destroy databases
6362
createdb: database creation failed on mydb.
64-
</ProgramListing>
65-
</Para>
66-
67-
<Para>
68-
<ProductName>Postgres</ProductName> allows you to create any number of databases
69-
at a given site and you automatically become the
70-
database administrator of the database you just created.
71-
Database names must have an alphabetic first
72-
character and are limited to 32 characters in length.
73-
</Para>
74-
75-
</Sect1>
76-
77-
<Sect1>
78-
<Title>Alternate Database Locations</Title>
79-
80-
<Para>
81-
It is possible to create a database in a location other than the default
82-
location for the installation. Remember that all database access actually
83-
occurs through the database backend, so that any location specified must
84-
be accessible by the backend.
85-
</Para>
86-
87-
<Para>
88-
Alternate database locations are created and referenced by an environment variable
89-
which gives the absolute path to the intended storage location.
90-
This environment variable must have been defined before the backend was started
91-
and the location it points to must be writable by the postgres administrator account.
92-
Consult with the site administrator
93-
regarding preconfigured alternate database locations.
94-
Any valid environment variable name may be used to reference an alternate location,
95-
although using variable names with a prefix of <quote>PGDATA</quote> is recommended
96-
to avoid confusion
97-
and conflict with other variables.
98-
</Para>
99-
100-
<Note>
101-
<Para>
102-
In previous versions of <ProductName>Postgres</ProductName>,
103-
it was also permissable to use an absolute path name to specify
104-
an alternate storage location.
105-
Although the environment variable style of specification
106-
is to be preferred since it allows the site administrator more flexibility in
107-
managing disk storage, it is also possible to use an absolute path
108-
to specify an alternate location.
109-
The administrator's guide discusses how to enable this feature.
110-
</Para>
111-
</Note>
112-
113-
<Para>
114-
For security and integrity reasons,
115-
any path or environment variable specified has some
116-
additional path fields appended.
117-
</Para>
118-
119-
<Para>
120-
Alternate database locations must be prepared by running
121-
<Application>initlocation</Application>.
122-
</Para>
123-
124-
<Para>
125-
To create a data storage area using the environment variable
126-
<envar>PGDATA2</envar> (for this example set to <filename>/alt/postgres</filename>),
127-
ensure that <FileName>/alt/postgres</FileName> already exists and is writable by
128-
the Postgres administrator account.
129-
Then, from the command line, type
130-
<ProgramListing>
63+
</ProgramListing>
64+
</Para>
65+
66+
<Para>
67+
<ProductName>Postgres</ProductName> allows you to create any number of databases
68+
at a given site and you automatically become the
69+
database administrator of the database you just created.
70+
Database names must have an alphabetic first
71+
character and are limited to 32 characters in length.
72+
</Para>
73+
74+
</Sect1>
75+
76+
<Sect1>
77+
<Title>Alternate Database Locations</Title>
78+
79+
<Para>
80+
It is possible to create a database in a location other than the default
81+
location for the installation. Remember that all database access actually
82+
occurs through the database backend, so that any location specified must
83+
be accessible by the backend.
84+
</Para>
85+
86+
<Para>
87+
Alternate database locations are created and referenced by an environment variable
88+
which gives the absolute path to the intended storage location.
89+
This environment variable must have been defined before the backend was started
90+
and the location it points to must be writable by the postgres administrator account.
91+
Consult with the site administrator
92+
regarding preconfigured alternate database locations.
93+
Any valid environment variable name may be used to reference an alternate location,
94+
although using variable names with a prefix of <quote>PGDATA</quote> is recommended
95+
to avoid confusion
96+
and conflict with other variables.
97+
</Para>
98+
99+
<Note>
100+
<Para>
101+
In previous versions of <ProductName>Postgres</ProductName>,
102+
it was also permissable to use an absolute path name to specify
103+
an alternate storage location.
104+
Although the environment variable style of specification
105+
is to be preferred since it allows the site administrator more flexibility in
106+
managing disk storage, it is also possible to use an absolute path
107+
to specify an alternate location.
108+
The administrator's guide discusses how to enable this feature.
109+
</Para>
110+
</Note>
111+
112+
<Para>
113+
For security and integrity reasons,
114+
any path or environment variable specified has some
115+
additional path fields appended.
116+
Alternate database locations must be prepared by running
117+
<Application>initlocation</Application>.
118+
</Para>
119+
120+
<Para>
121+
To create a data storage area using the environment variable
122+
<envar>PGDATA2</envar> (for this example set to <filename>/alt/postgres</filename>),
123+
ensure that <FileName>/alt/postgres</FileName> already exists and is writable by
124+
the Postgres administrator account.
125+
Then, from the command line, type
126+
<ProgramListing>
131127
% initlocation $PGDATA2
132128
Creating Postgres database system directory /alt/postgres/data
133129
Creating Postgres database system directory /alt/postgres/data/base
134-
</ProgramListing>
135-
</Para>
130+
</ProgramListing>
131+
</Para>
136132

137-
<Para>
138-
To create a database in the alternate storage area <envar>PGDATA2</envar>
139-
from the command line, use the following command:
140-
<ProgramListing>
133+
<Para>
134+
To create a database in the alternate storage area <envar>PGDATA2</envar>
135+
from the command line, use the following command:
136+
<ProgramListing>
141137
% createdb -D PGDATA2 mydb
142-
</ProgramListing>
138+
</ProgramListing>
143139

144-
To do the same from within <Application>psql</Application> type
145-
<ProgramListing>
140+
and to do the same from within <Application>psql</Application> type
141+
<ProgramListing>
146142
* CREATE DATABASE mydb WITH LOCATION = 'PGDATA2';
147-
</ProgramListing>
148-
</Para>
143+
</ProgramListing>
144+
</Para>
149145

150-
<Para>
151-
If you do not have the privileges required to create a database, you will see
152-
the following:
153-
<ProgramListing>
146+
<Para>
147+
If you do not have the privileges required to create a database, you will see
148+
the following:
149+
<ProgramListing>
154150
% createdb mydb
155151
WARN:user "your username" is not allowed to create/destroy databases
156152
createdb: database creation failed on mydb.
157-
</ProgramListing>
158-
</Para>
159-
160-
<Para>
161-
If the specified location does not exist or the database backend does not have
162-
permission to access it or to write to directories under it, you will see
163-
the following:
164-
<ProgramListing>
153+
</ProgramListing>
154+
</Para>
155+
156+
<Para>
157+
If the specified location does not exist or the database backend does not have
158+
permission to access it or to write to directories under it, you will see
159+
the following:
160+
<ProgramListing>
165161
% createdb -D /alt/postgres/data mydb
166162
ERROR: Unable to create database directory /alt/postgres/data/base/mydb
167163
createdb: database creation failed on mydb.
168-
</ProgramListing>
169-
</Para>
164+
</ProgramListing>
165+
</Para>
170166

171-
</Sect1>
167+
</Sect1>
172168

173169
<Sect1>
174170
<Title>Accessing a Database</Title>
@@ -296,3 +292,20 @@ TBD
296292
</Sect1>
297293

298294
</Chapter>
295+
296+
<!-- Keep this comment at the end of the file
297+
Local variables:
298+
mode: sgml
299+
sgml-omittag:nil
300+
sgml-shorttag:t
301+
sgml-minimize-attributes:nil
302+
sgml-always-quote-attributes:t
303+
sgml-indent-step:1
304+
sgml-indent-data:t
305+
sgml-parent-document:nil
306+
sgml-default-dtd-file:"./reference.ced"
307+
sgml-exposed-tags:nil
308+
sgml-local-catalogs:"/usr/lib/sgml/CATALOG"
309+
sgml-local-ecat-files:nil
310+
End:
311+
-->

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp