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

Commit78bb800

Browse files
committed
Update initdb locale/encoding documentation description. Backpatch to
8.0.X.
1 parent1808ce7 commit78bb800

File tree

1 file changed

+36
-34
lines changed

1 file changed

+36
-34
lines changed

‎doc/src/sgml/ref/initdb.sgml

Lines changed: 36 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$PostgreSQL: pgsql/doc/src/sgml/ref/initdb.sgml,v 1.33 2005/01/04 00:05:45 momjian Exp $
2+
$PostgreSQL: pgsql/doc/src/sgml/ref/initdb.sgml,v 1.34 2005/02/22 02:54:19 momjian Exp $
33
PostgreSQL documentation
44
-->
55

@@ -43,34 +43,23 @@ PostgreSQL documentation
4343
</para>
4444

4545
<para>
46-
Creating a database cluster consists of creating the directories in which
47-
the database data will live, generating the shared catalog tables
48-
(tables that belong to the whole cluster rather than to any particular
49-
database), and creating the <literal>template1</literal>
50-
database. When you later create a new database, everything in the
51-
<literal>template1</literal> database is copied.
52-
It contains catalog tables filled in for things like the
53-
built-in types.
46+
Creating a database cluster consists of creating the directories in
47+
which the database data will live, generating the shared catalog
48+
tables (tables that belong to the whole cluster rather than to any
49+
particular database), and creating the <literal>template1</literal>
50+
database. When you later create a new database, everything in the
51+
<literal>template1</literal> database is copied. It contains catalog
52+
tables containing things like built-in data types.
5453
</para>
5554

5655
<para>
57-
<command>initdb</command> initializes the database cluster's default
58-
locale and character set encoding. Some locale categories are fixed
59-
for the lifetime of the cluster. There is also a performance impact
60-
in using locales other than <literal>C</> or <literal>POSIX</>.
61-
Therefore it is important to make the right choice when running
62-
<command>initdb</command>. Other locale categories can be changed
63-
later when the server is started. <command>initdb</command> will
64-
write those locale settings into the
65-
<filename>postgresql.conf</filename> configuration file so they are
66-
the default, but they can be changed by editing that file. To set the
67-
locale that <command>initdb</command> uses, see the description of
68-
the <option>--locale</option> option. The character set encoding can
69-
be set separately for each database as it is created.
70-
<command>initdb</command> determines the encoding for the
71-
<literal>template1</literal> database, which will serve as the
72-
default for all other databases. To alter the default encoding use
73-
the <option>--encoding</option> option.
56+
Although <command>initdb</command> will attempt to create the
57+
specified data directory, it might not have permission if the parent
58+
directory of the desired data directory is root-owned. To initialize
59+
in such a setup, create an empty data directory as root, then use
60+
<command>chown</command> to assign ownership of that directory to the
61+
database user account, then <command>su</command> to become the
62+
database user to run <command>initdb</command>.
7463
</para>
7564

7665
<para>
@@ -83,15 +72,28 @@ PostgreSQL documentation
8372
</para>
8473

8574
<para>
86-
Although <command>initdb</command> will attempt to create the
87-
specified data directory, often it won't have permission to do so,
88-
since the parent of the desired data directory is often a root-owned
89-
directory. To set up an arrangement like this, create an empty data
90-
directory as root, then use <command>chown</command> to hand over
91-
ownership of that directory to the database user account, then
92-
<command>su</command> to become the database user, and
93-
finally run <command>initdb</command> as the database user.
75+
<command>initdb</command> initializes the database cluster's default
76+
locale and character set encoding. The collation order
77+
(<literal>LC_COLLATE</>) and character set classes
78+
(<literal>LC_CTYPE</>, e.g. upper, lower, digit) are fixed for all
79+
databases and can not be changed. Collation orders other than
80+
<literal>C</> or <literal>POSIX</> also have a performance penalty.
81+
For these reasons it is important to choose the right locale when
82+
running <command>initdb</command>. The remaining locale categories
83+
can be changed later when the server is started. All server locale
84+
values (<literal>lc_*</>) can be displayed via <command>SHOW ALL</>.
85+
More details can be found in <xref linkend="locale">.
9486
</para>
87+
88+
<para>
89+
The character set encoding can be set separately for a database when
90+
it is created. <command>initdb</command> determines the encoding for
91+
the <literal>template1</literal> database, which will serve as the
92+
default for all other databases. To alter the default encoding use
93+
the <option>--encoding</option> option. More details can be found in
94+
<xref linkend="multibyte">.
95+
</para>
96+
9597
</refsect1>
9698

9799
<refsect1>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp