-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp-initdb.html
More file actions
428 lines (425 loc) · 38.8 KB
/
app-initdb.html
File metadata and controls
428 lines (425 loc) · 38.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>initdb</title><link rel="stylesheet" type="text/css" href="stylesheet.css" /><link rev="made" href="pgsql-docs@lists.postgresql.org" /><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /><link rel="prev" href="reference-server.html" title="PostgreSQLサーバアプリケーション" /><link rel="next" href="pgarchivecleanup.html" title="pg_archivecleanup" /><meta name="viewport" content="width=device-width,initial-scale=1.0" /></head><body id="docContent" class="container-fluid col-10"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="4" align="center"><a accesskey="h" href="index.html">PostgreSQL 14.5文書</a></th></tr><tr><td width="10%" align="left"></td><td width="10%" align="left"></td><td width="60%" align="center"><a href="reference-server.html" title="PostgreSQLサーバアプリケーション">PostgreSQLサーバアプリケーション</a></td><td width="20%" align="right"><div class="actions"><a class="issue" title="github" href="https://github.com/pgsql-jp/jpug-doc/issues/new?template=bug_report.yml&what-happened=version 14.5 : app-initdb.html">誤訳等の報告
</a></div></td></tr><tr><td width="10%" align="left"><a accesskey="p" href="reference-server.html" title="PostgreSQLサーバアプリケーション">前へ</a> </td><td width="10%" align="left"><a accesskey="u" href="reference-server.html" title="PostgreSQLサーバアプリケーション">上へ</a></td><td width="60%" align="center"><span class="application">initdb</span></td><td width="20%" align="right"> <a accesskey="n" href="pgarchivecleanup.html" title="pg_archivecleanup">次へ</a></td></tr></table><hr /></div><div class="refentry" id="APP-INITDB"><div class="titlepage"></div><a id="id-1.9.5.3.1" class="indexterm"></a><div class="refnamediv"><h2><span class="refentrytitle"><span class="application">initdb</span></span></h2><p>initdb<span class="original">
<refpurpose>create a new <productname>PostgreSQL</productname> database cluster</refpurpose>
</span> — <span class="productname">PostgreSQL</span>のデータベースクラスタを新しく作成する</p></div><div class="refsynopsisdiv"><h2>概要</h2><div class="cmdsynopsis"><p id="id-1.9.5.3.4.1"><code class="command">initdb</code> [<em class="replaceable"><code>option</code></em>...] [ <code class="option">--pgdata</code> | <code class="option">-D</code> ]<em class="replaceable"><code> directory</code></em> </p></div></div><div class="refsect1" id="R1-APP-INITDB-1"><h2>説明</h2><span class="original">
<title>Description</title>
</span><p>
<span class="original">
<command>initdb</command> creates a new
<productname>PostgreSQL</productname> database cluster. A database
cluster is a collection of databases that are managed by a single
server instance.
</span>
<code class="command">initdb</code>は<span class="productname">PostgreSQL</span>のデータベースクラスタを新しく作成します。
データベースクラスタとは、1つのサーバインスタンスで管理されるデータベースの集合です。
</p><p>
<span class="original">
Creating a database cluster consists of creating the directories in
which the database data will live, generating the shared catalog
tables (tables that belong to the whole cluster rather than to any
particular database), and creating the <literal>template1</literal>
and <literal>postgres</literal> databases. When you later create a
new database, everything in the <literal>template1</literal> database is
copied. (Therefore, anything installed in <literal>template1</literal>
is automatically copied into each database created later.)
The <literal>postgres</literal> database is a default database meant
for use by users, utilities and third party applications.
</span>
データベースクラスタの作成には、データベースのデータを保存するディレクトリの作成、共有カタログテーブル(特定のデータベースではなく、クラスタ全体に所属するテーブル)の生成、そして<code class="literal">template1</code>データベースと<code class="literal">postgres</code>データベースの作成といった作業が含まれます。
後から新しいデータベースを作成する際は、<code class="literal">template1</code>データベースの全ての内容がコピーされます。
(つまり、<code class="literal">template1</code>にインストールしたものすべてが、後に生成した各データベースに自動的にコピーされます。)
<code class="literal">postgres</code>データベースは、ユーザ、ユーティリティ、サードパーティ製アプリケーションのデフォルトデータベースとしての使用を意図したものです。
</p><p>
<span class="original">
Although <command>initdb</command> will attempt to create the
specified data directory, it might not have permission if the parent
directory of the desired data directory is root-owned. To initialize
in such a setup, create an empty data directory as root, then use
<command>chown</command> to assign ownership of that directory to the
database user account, then <command>su</command> to become the
database user to run <command>initdb</command>.
</span>
<code class="command">initdb</code>は指定されたデータディレクトリを作成しようと試みますが、そのデータディレクトリの親ディレクトリの所有者がrootであるなど、権限がないことがあります。
このような場合、まず、空のデータディレクトリをrootで作成し、<code class="command">chown</code>を使ってそのディレクトリの所有権限をデータベースのユーザに変えてください。
次に<code class="command">su</code>を使ってデータベースユーザとなり、<code class="command">initdb</code>を実行します。
</p><p>
<span class="original">
<command>initdb</command> must be run as the user that will own the
server process, because the server needs to have access to the
files and directories that <command>initdb</command> creates.
Since the server cannot be run as root, you must not run
<command>initdb</command> as root either. (It will in fact refuse
to do so.)
</span>
<code class="command">initdb</code>は、サーバプロセスの所有者となるユーザによって実行されなければなりません。
<code class="command">initdb</code>によって作成されるファイルやディレクトリにサーバがアクセスできる必要があるからです。
サーバをrootとして実行することはできませんので、rootで<code class="command">initdb</code>を実行してはいけません
(実際には、実行しようとしても拒否されます)。
</p><p>
<span class="original">
For security reasons the new cluster created by <command>initdb</command>
will only be accessible by the cluster owner by default. The
<option>&#045;-allow-group-access</option> option allows any user in the same
group as the cluster owner to read files in the cluster. This is useful
for performing backups as a non-privileged user.
</span>
セキュリティ上の理由から、デフォルトでは<code class="command">initdb</code>により作られた新しいクラスタはクラスタの所有者だけがアクセスできます。
<code class="option">--allow-group-access</code>により、クラスタの所有者と同じグループのユーザがクラスタ内のファイルを読めるようになります。
これは非特権ユーザとしてバックアップを実行するのに有用です。
</p><p>
<span class="original">
<command>initdb</command> initializes the database cluster's default
locale and character set encoding. The character set encoding,
collation order (<literal>LC_COLLATE</literal>) and character set classes
(<literal>LC_CTYPE</literal>, e.g., upper, lower, digit) can be set separately
for a database when it is created. <command>initdb</command> determines
those settings for the <literal>template1</literal> database, which will
serve as the default for all other databases.
</span>
<code class="command">initdb</code>は、データベースクラスタのデフォルトのロケールと文字セット符号化方式を初期化します。
文字セット符号化方式、照合順(<code class="literal">LC_COLLATE</code>)および文字セットクラス(<code class="literal">LC_CTYPE</code>、例えば、大文字、小文字、数字)は、データベース作成時、別々に設定することができます。
<code class="command">initdb</code>は<code class="literal">template1</code>データベース用のこれらの値を決定します。
この値が他のすべてのデータベースのデフォルトとして提供されます。
</p><p>
<span class="original">
To alter the default collation order or character set classes, use the
<option>&#045;&#045;lc-collate</option> and <option>&#045;&#045;lc-ctype</option> options.
Collation orders other than <literal>C</literal> or <literal>POSIX</literal> also have
a performance penalty. For these reasons it is important to choose the
right locale when running <command>initdb</command>.
</span>
デフォルトの照合順や文字セットクラスを変更するためには、<code class="option">--lc-collate</code>および<code class="option">--lc-ctype</code>オプションを使用してください。
<code class="literal">C</code>や<code class="literal">POSIX</code>以外の照合順には性能の劣化が伴います。
これらの理由により<code class="command">initdb</code>実行時にロケールを正しく選択することが重要です。
</p><p>
<span class="original">
The remaining locale categories can be changed later when the server
is started. You can also use <option>&#045;&#045;locale</option> to set the
default for all locale categories, including collation order and
character set classes. All server locale values (<literal>lc_*</literal>) can
be displayed via <command>SHOW ALL</command>.
More details can be found in <xref linkend="locale"/>.
</span>
残りのロケール関連のものはサーバ起動時に変更することができます。
<code class="option">--locale</code>を使用して、照合順や文字セットクラスを含む、すべてのロケール関連のもののデフォルトを設定することも可能です。
<code class="command">SHOW ALL</code>を使用して、すべてのサーバのロケール値(<code class="literal">lc_*</code>)を表示することができます。
詳細は<a class="xref" href="locale.html" title="24.1. ロケールのサポート">24.1</a>に記載しています。
</p><p>
<span class="original">
To alter the default encoding, use the <option>&#045;&#045;encoding</option>.
More details can be found in <xref linkend="multibyte"/>.
</span>
デフォルトの符号化方式を変更するには、<code class="option">--encoding</code>オプションを使用します。
詳細は<a class="xref" href="multibyte.html" title="24.3. 文字セットサポート">24.3</a>に記載しています。
</p></div><div class="refsect1" id="id-1.9.5.3.6"><h2>オプション</h2><span class="original">
<title>Options</title>
</span><p>
</p><div class="variablelist"><dl class="variablelist"><dt><span class="term"><code class="option">-A <em class="replaceable"><code>authmethod</code></em></code><br /></span><span class="term"><code class="option">--auth=<em class="replaceable"><code>authmethod</code></em></code></span></dt><dd><p>
<span class="original">
This option specifies the default authentication method for local
users used in <filename>pg_hba.conf</filename> (<literal>host</literal>
and <literal>local</literal> lines). <command>initdb</command> will
prepopulate <filename>pg_hba.conf</filename> entries using the
specified authentication method for non-replication as well as
replication connections.
</span>
このオプションは、<code class="filename">pg_hba.conf</code>にてローカルユーザ用に使用されるデフォルトの認証方法(<code class="literal">host</code>行と<code class="literal">local</code>行)を指定します。
<code class="command">initdb</code>は、非レプリケーションおよびレプリケーションの接続について、指定の認証方式を使うエントリを<code class="filename">pg_hba.conf</code>に作成します。
</p><p>
<span class="original">
Do not use <literal>trust</literal> unless you trust all local users on your
system. <literal>trust</literal> is the default for ease of installation.
</span>
システムのすべてのローカルユーザが信頼できるわけではない場合は、<code class="literal">trust</code>を使用しないでください。
インストールを簡単にするために<code class="literal">trust</code>がデフォルトになっています。
</p></dd><dt><span class="term"><code class="option">--auth-host=<em class="replaceable"><code>authmethod</code></em></code></span></dt><dd><p>
<span class="original">
This option specifies the authentication method for local users via
TCP/IP connections used in <filename>pg_hba.conf</filename>
(<literal>host</literal> lines).
</span>
このオプションは<code class="filename">pg_hba.conf</code>にてTCP/IP接続経由のローカルユーザ用に使用される認証方法(<code class="literal">host</code>行)を指定します。
</p></dd><dt><span class="term"><code class="option">--auth-local=<em class="replaceable"><code>authmethod</code></em></code></span></dt><dd><p>
<span class="original">
This option specifies the authentication method for local users via
Unix-domain socket connections used in <filename>pg_hba.conf</filename>
(<literal>local</literal> lines).
</span>
このオプションは<code class="filename">pg_hba.conf</code>にてUnixドメインソケット接続経由のローカルユーザ用に使用される認証方法(<code class="literal">local</code>行)を指定します。
</p></dd><dt><span class="term"><code class="option">-D <em class="replaceable"><code>directory</code></em></code><br /></span><span class="term"><code class="option">--pgdata=<em class="replaceable"><code>directory</code></em></code></span></dt><dd><p>
<span class="original">
This option specifies the directory where the database cluster
should be stored. This is the only information required by
<command>initdb</command>, but you can avoid writing it by
setting the <envar>PGDATA</envar> environment variable, which
can be convenient since the database server
(<command>postgres</command>) can find the database
directory later by the same variable.
</span>
このオプションは、データベースクラスタを格納すべきディレクトリを指定します。
<code class="command">initdb</code>が必要とする情報はこれだけですが、環境変数<code class="envar">PGDATA</code>を設定しておけば、このオプションの指定を省略できます。
この方法は、後に同じ変数を使用してデータベースサーバ(<code class="command">postgres</code>)がデータベースディレクトリを参照できるので、便利です。
</p></dd><dt><span class="term"><code class="option">-E <em class="replaceable"><code>encoding</code></em></code><br /></span><span class="term"><code class="option">--encoding=<em class="replaceable"><code>encoding</code></em></code></span></dt><dd><p>
<span class="original">
Selects the encoding of the template database. This will also
be the default encoding of any database you create later,
unless you override it there. The default is derived from the locale, or
<literal>SQL_ASCII</literal> if that does not work. The character sets supported by
the <productname>PostgreSQL</productname> server are described
in <xref linkend="multibyte-charset-supported"/>.
</span>
テンプレートデータベースの符号化方式を選択します。
これが今後作成される全てのデータベースについてのデフォルト符号化方式となりますが、作成時に上書きすることもできます。
デフォルトは、ロケールから取得しますが、取得できなければ<code class="literal">SQL_ASCII</code>になります。
<span class="productname">PostgreSQL</span>サーバによってサポートされる文字セットについては<a class="xref" href="multibyte.html#MULTIBYTE-CHARSET-SUPPORTED" title="24.3.1. サポートされる文字セット">24.3.1</a>で説明します。
</p></dd><dt id="APP-INITDB-ALLOW-GROUP-ACCESS"><span class="term"><code class="option">-g</code><br /></span><span class="term"><code class="option">--allow-group-access</code></span></dt><dd><p>
<span class="original">
Allows users in the same group as the cluster owner to read all cluster
files created by <command>initdb</command>. This option is ignored
on <productname>Windows</productname> as it does not support
<acronym>POSIX</acronym>-style group permissions.
</span>
クラスタの所有者と同じグループのユーザが、<code class="command">initdb</code>により作られたクラスタファイルすべてを読むことを許可します。
<span class="productname">Windows</span>では<acronym class="acronym">POSIX</acronym>形式のグループパーミッションをサポートしませんので、このオプションは無視されます。
</p></dd><dt id="APP-INITDB-DATA-CHECKSUMS"><span class="term"><code class="option">-k</code><br /></span><span class="term"><code class="option">--data-checksums</code></span></dt><dd><p>
<span class="original">
Use checksums on data pages to help detect corruption by the
I/O system that would otherwise be silent. Enabling checksums
may incur a noticeable performance penalty. If set, checksums
are calculated for all objects, in all databases. All checksum
failures will be reported in the
<link linkend="monitoring-pg-stat-database-view">
<structname>pg_stat_database</structname></link> view.
See <xref linkend="checksums" /> for details.
</span>
I/Oシステムによる破損検知を補助するために、データページにおいてチェックサムを使用します。
これがないと警告もされません。
チェックサムを有効にすると、認知できる程度の性能低下が発生する可能性があります。
設定した場合、すべてのデータベースにおいて、すべてのオブジェクトに対してチェックサムが計算されます。
チェックサムの失敗はすべて<a class="link" href="monitoring-stats.html#MONITORING-PG-STAT-DATABASE-VIEW" title="28.2.13. pg_stat_database"><code class="structname">pg_stat_database</code></a>ビューで報告されます。
詳細については<a class="xref" href="checksums.html" title="30.2. データチェックサム">30.2</a>を参照してください。
</p></dd><dt><span class="term"><code class="option">--locale=<em class="replaceable"><code>locale</code></em></code></span></dt><dd><p>
<span class="original">
Sets the default locale for the database cluster. If this
option is not specified, the locale is inherited from the
environment that <command>initdb</command> runs in. Locale
support is described in <xref linkend="locale"/>.
</span>
データベースクラスタ用のデフォルトのロケールを設定します。
このオプションを指定しない場合は、<code class="command">initdb</code>を実行している環境のロケールが継承されます。
ロケールサポートについては<a class="xref" href="locale.html" title="24.1. ロケールのサポート">24.1</a>で説明します。
</p></dd><dt><span class="term"><code class="option">--lc-collate=<em class="replaceable"><code>locale</code></em></code><br /></span><span class="term"><code class="option">--lc-ctype=<em class="replaceable"><code>locale</code></em></code><br /></span><span class="term"><code class="option">--lc-messages=<em class="replaceable"><code>locale</code></em></code><br /></span><span class="term"><code class="option">--lc-monetary=<em class="replaceable"><code>locale</code></em></code><br /></span><span class="term"><code class="option">--lc-numeric=<em class="replaceable"><code>locale</code></em></code><br /></span><span class="term"><code class="option">--lc-time=<em class="replaceable"><code>locale</code></em></code></span></dt><dd><p>
<span class="original">
Like <option>&#045;&#045;locale</option>, but only sets the locale in
the specified category.
</span>
<code class="option">--locale</code>と似ていますが、指定したカテゴリのロケールのみを設定します。
</p></dd><dt><span class="term"><code class="option">--no-locale</code></span></dt><dd><p>
<span class="original">
Equivalent to <option>&#045;-locale=C</option>.
</span>
<code class="option">--locale=C</code>と同じです。
</p></dd><dt><span class="term"><code class="option">-N</code><br /></span><span class="term"><code class="option">--no-sync</code></span></dt><dd><p>
<span class="original">
By default, <command>initdb</command> will wait for all files to be
written safely to disk. This option causes <command>initdb</command>
to return without waiting, which is faster, but means that a
subsequent operating system crash can leave the data directory
corrupt. Generally, this option is useful for testing, but should not
be used when creating a production installation.
</span>
デフォルトでは<code class="command">initdb</code>はすべてのファイルが安全にディスクに書き出されるまで待機します。
このオプションを使うと<code class="command">initdb</code>は待機せずに返るようになり、より高速になりますが、後でオペレーティングシステムがクラッシュした場合にデータディレクトリが破損状態になってしまう可能性があります。
通常、このオプションは試験用では有用ですが、実用のインストレーションを作成する際に使用すべきではありません。
</p></dd><dt><span class="term"><code class="option">--no-instructions</code></span></dt><dd><p>
<span class="original">
By default, <command>initdb</command> will write instructions for how
to start the cluster at the end of its output. This option causes
those instructions to be left out. This is primarily intended for use
by tools that wrap <command>initdb</command> in platform-specific
behavior, where those instructions are likely to be incorrect.
</span>
デフォルトでは<code class="command">initdb</code>は出力の最後にクラスタを起動する手順を表示します。
このオプションを使うと、これらの手順が省略されます。
これは主に<code class="command">initdb</code>をプラットフォーム固有の動作でラップするツールで、これらの手順が間違っている可能性がある場合に使用することを目的としています。
</p></dd><dt><span class="term"><code class="option">--pwfile=<em class="replaceable"><code>filename</code></em></code></span></dt><dd><p>
<span class="original">
Makes <command>initdb</command> read the database superuser's password
from a file. The first line of the file is taken as the password.
</span>
<code class="command">initdb</code>はデータベーススーパーユーザのパスワードをこのファイルから読み取ります。
このファイルの最初の行がパスワードとして解釈されます。
</p></dd><dt><span class="term"><code class="option">-S</code><br /></span><span class="term"><code class="option">--sync-only</code></span></dt><dd><p>
<span class="original">
Safely write all database files to disk and exit. This does not
perform any of the normal <application>initdb</application> operations.
</span>
すべてのデータベースファイルを安全にディスクに書き出し、終了します。
これは通常の<span class="application">initdb</span>の操作をまったく行いません。
</p></dd><dt><span class="term"><code class="option">-T <em class="replaceable"><code>config</code></em></code><br /></span><span class="term"><code class="option">--text-search-config=<em class="replaceable"><code>config</code></em></code></span></dt><dd><p>
<span class="original">
Sets the default text search configuration.
See <xref linkend="guc-default-text-search-config"/> for further information.
</span>
デフォルトの全文検索設定を設定します。
詳細については<a class="xref" href="runtime-config-client.html#GUC-DEFAULT-TEXT-SEARCH-CONFIG">default_text_search_config</a>を参照してください。
</p></dd><dt><span class="term"><code class="option">-U <em class="replaceable"><code>username</code></em></code><br /></span><span class="term"><code class="option">--username=<em class="replaceable"><code>username</code></em></code></span></dt><dd><p>
<span class="original">
Selects the user name of the database superuser. This defaults
to the name of the effective user running
<command>initdb</command>. It is really not important what the
superuser's name is, but one might choose to keep the
customary name <systemitem>postgres</systemitem>, even if the operating
system user's name is different.
</span>
データベースのスーパーユーザのユーザ名を選択します。
<code class="command">initdb</code>を実行している実効ユーザの名前がデフォルトです。
スーパーユーザの名前はあまり重要ではありませんが、慣習的に使われている<span class="systemitem">postgres</span>を(オペレーティングシステムのユーザ名と異なっていても)使っても良いでしょう。
</p></dd><dt><span class="term"><code class="option">-W</code><br /></span><span class="term"><code class="option">--pwprompt</code></span></dt><dd><p>
<span class="original">
Makes <command>initdb</command> prompt for a password
to give the database superuser. If you don't plan on using password
authentication, this is not important. Otherwise you won't be
able to use password authentication until you have a password
set up.
</span>
<code class="command">initdb</code>にデータベースのスーパーユーザ権限を与えるためのパスワード入力のプロンプトを表示させます。
パスワード認証を行うつもりがない場合は必要ありません。
このオプションを指定しても、パスワードの設定を行わない限りパスワード認証は行われません。
</p></dd><dt><span class="term"><code class="option">-X <em class="replaceable"><code>directory</code></em></code><br /></span><span class="term"><code class="option">--waldir=<em class="replaceable"><code>directory</code></em></code></span></dt><dd><p>
<span class="original">
This option specifies the directory where the write-ahead log
should be stored.
</span>
このオプションは先行書き込みログの格納ディレクトリを指定します。
</p></dd><dt><span class="term"><code class="option">--wal-segsize=<em class="replaceable"><code>size</code></em></code></span></dt><dd><p>
<span class="original">
Set the <firstterm>WAL segment size</firstterm>, in megabytes. This
is the size of each individual file in the WAL log. The default size
is 16 megabytes. The value must be a power of 2 between 1 and 1024
(megabytes). This option can only be set during initialization, and
cannot be changed later.
</span>
<em class="firstterm">WALセグメントサイズ</em>をメガバイト単位で設定します。
これはWALログの個々のファイルの大きさです。
デフォルトの大きさは16メガバイトです。
値は1から1024の間の2の冪でなければなりません。
このオプションは初期化の際にのみ設定することができ、後で変更することはできません。
</p><p>
<span class="original">
It may be useful to adjust this size to control the granularity of
WAL log shipping or archiving. Also, in databases with a high volume
of WAL, the sheer number of WAL files per directory can become a
performance and management problem. Increasing the WAL file size
will reduce the number of WAL files.
</span>
WALログのシッピングやアーカイブの粒度を制御するために、この大きさを調整することは有用でしょう。
また、大量のWALのあるデータベースでは、ディレクトリ当たりのWALファイルの数だけでパフォーマンスや管理の問題となり得ます。
WALファイルの大きさを増やせば、WALファイルの数は減るでしょう。
</p></dd></dl></div><p>
</p><p>
<span class="original">
Other, less commonly used, options are also available:
</span>
この他にも、使用頻度は下がりますが、下記のオプションが使用可能です。
</p><div class="variablelist"><dl class="variablelist"><dt><span class="term"><code class="option">-d</code><br /></span><span class="term"><code class="option">--debug</code></span></dt><dd><p>
<span class="original">
Print debugging output from the bootstrap backend and a few other
messages of lesser interest for the general public.
The bootstrap backend is the program <command>initdb</command>
uses to create the catalog tables. This option generates a tremendous
amount of extremely boring output.
</span>
ブートストラップバックエンドからのデバッグ情報と、一般の利用者にはおそらく不要なその他の情報を出力します。
ブートストラップバックエンドとは<code class="command">initdb</code>がカタログテーブルを作成する際に使用するプログラムです。
このオプションはうんざりするようなログを大量に出力します。
</p></dd><dt><span class="term"><code class="option">--discard-caches</code></span></dt><dd><p>
<span class="original">
Run the bootstrap backend with the
<literal>debug_discard_caches=1</literal> option.
This takes a very long time and is only of use for deep debugging.
</span>
<code class="literal">debug_discard_caches=1</code>オプションをつけてブートストラップバックエンドを実行します。
これは非常に長い時間がかかるため、難解なデバッグでのみ使用されます。
</p></dd><dt><span class="term"><code class="option">-L <em class="replaceable"><code>directory</code></em></code></span></dt><dd><p>
<span class="original">
Specifies where <command>initdb</command> should find
its input files to initialize the database cluster. This is
normally not necessary. You will be told if you need to
specify their location explicitly.
</span>
データベースクラスタを初期化する際に、<code class="command">initdb</code>が参照すべき入力ファイルを指定します。
これは通常必要ありません。
明示的に指定する必要がある場合は、その時に指定するよう要求されます。
</p></dd><dt><span class="term"><code class="option">-n</code><br /></span><span class="term"><code class="option">--no-clean</code></span></dt><dd><p>
<span class="original">
By default, when <command>initdb</command>
determines that an error prevented it from completely creating the database
cluster, it removes any files it might have created before discovering
that it cannot finish the job. This option inhibits tidying-up and is
thus useful for debugging.
</span>
デフォルトでは、<code class="command">initdb</code>を実行中にエラーが発生し、データベースクラスタを完成できなかった場合に、そのエラーが発生する前に作成された全てのファイルを削除します。
このオプションを指定すると、これらのファイルが削除しないで残されるので、デバッグの際にはとても便利です。
</p></dd></dl></div><p>
</p><p>
<span class="original">
Other options:
</span>
その他のオプションを以下に示します。
</p><div class="variablelist"><dl class="variablelist"><dt><span class="term"><code class="option">-V</code><br /></span><span class="term"><code class="option">--version</code></span></dt><dd><p>
<span class="original">
Print the <application>initdb</application> version and exit.
</span>
<span class="application">initdb</span>のバージョンを表示し、終了します。
</p></dd><dt><span class="term"><code class="option">-?</code><br /></span><span class="term"><code class="option">--help</code></span></dt><dd><p>
<span class="original">
Show help about <application>initdb</application> command line
arguments, and exit.
</span>
<span class="application">initdb</span>のコマンドライン引数の使用方法を表示し、終了します。
</p></dd></dl></div><p>
</p></div><div class="refsect1" id="id-1.9.5.3.7"><h2>環境</h2><span class="original">
<title>Environment</title>
</span><div class="variablelist"><dl class="variablelist"><dt><span class="term"><code class="envar">PGDATA</code></span></dt><dd><p>
<span class="original">
Specifies the directory where the database cluster is to be
stored; can be overridden using the <option>-D</option> option.
</span>
データベースクラスタを保存するディレクトリを指定します。
<code class="option">-D</code>オプションを使用して上書きすることができます。
</p></dd><dt><span class="term"><code class="envar">PG_COLOR</code></span></dt><dd><p>
<span class="original">
Specifies whether to use color in diagnostic messages. Possible values
are <literal>always</literal>, <literal>auto</literal> and
<literal>never</literal>.
</span>
診断メッセージで色を使うかどうかを指定します。
可能な値は<code class="literal">always</code>、<code class="literal">auto</code>、<code class="literal">never</code>です。
</p></dd><dt><span class="term"><code class="envar">TZ</code></span></dt><dd><p>
<span class="original">
Specifies the default time zone of the created database cluster. The
value should be a full time zone name
(see <xref linkend="datatype-timezones"/>).
</span>
作成されるデータベースクラスタのデフォルトの時間帯を指定します。
値は完全な時間帯の名前で指定することが望ましいです(<a class="xref" href="datatype-datetime.html#DATATYPE-TIMEZONES" title="8.5.3. 時間帯">8.5.3</a>参照)。
</p></dd></dl></div><p>
<span class="original">
This utility, like most other <productname>PostgreSQL</productname> utilities,
also uses the environment variables supported by <application>libpq</application>
(see <xref linkend="libpq-envars"/>).
</span>
また、このユーティリティは、他のほとんどの<span class="productname">PostgreSQL</span>ユーティリティと同様、<span class="application">libpq</span>でサポートされる環境変数を使用します(<a class="xref" href="libpq-envars.html" title="34.15. 環境変数">34.15</a>を参照してください)。
</p></div><div class="refsect1" id="id-1.9.5.3.8"><h2>注釈</h2><span class="original">
<title>Notes</title>
</span><p>
<span class="original">
<command>initdb</command> can also be invoked via
<command>pg_ctl initdb</command>.
</span>
<code class="command">initdb</code>は<code class="command">pg_ctl initdb</code>経由でも呼び出すことができます。
</p></div><div class="refsect1" id="id-1.9.5.3.9"><h2>関連項目</h2><span class="original">
<title>See Also</title>
</span><span class="simplelist"><a class="xref" href="app-pg-ctl.html" title="pg_ctl"><span class="refentrytitle"><span class="application">pg_ctl</span></span></a>, <a class="xref" href="app-postgres.html" title="postgres"><span class="refentrytitle"><span class="application">postgres</span></span></a></span></div></div><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="navfooter"><hr></hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="reference-server.html" title="PostgreSQLサーバアプリケーション">前へ</a> </td><td width="20%" align="center"><a accesskey="u" href="reference-server.html" title="PostgreSQLサーバアプリケーション">上へ</a></td><td width="40%" align="right"> <a accesskey="n" href="pgarchivecleanup.html" title="pg_archivecleanup">次へ</a></td></tr><tr><td width="40%" align="left" valign="top">PostgreSQLサーバアプリケーション </td><td width="20%" align="center"><a accesskey="h" href="index.html" title="PostgreSQL 14.5文書">ホーム</a></td><td width="40%" align="right" valign="top"> <span xmlns="http://www.w3.org/1999/xhtml" class="application">pg_archivecleanup</span></td></tr></table></div></body></html>