-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp-pg-ctl.html
More file actions
372 lines (372 loc) · 41.8 KB
/
Copy pathapp-pg-ctl.html
File metadata and controls
372 lines (372 loc) · 41.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
<?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>pg_ctl</title><link rel="stylesheet" type="text/css" href="stylesheet.css" /><link rev="made" href="pgsql-docs@postgresql.org" /><meta name="generator" content="DocBook XSL Stylesheets V1.79.1" /><link rel="prev" href="app-pgcontroldata.html" title="pg_controldata" /><link rel="next" href="app-pgresetxlog.html" title="pg_resetxlog" /><meta name="viewport" content="width=device-width,initial-scale=1.0" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><td width="20%" align="left" colspan="2"></td><th width="60%" align="center"><a accesskey="h" href="index.html">PostgreSQL 9.6.5文書</a></th><td width="20%" align="right"><div class="actions"><a class="issue" href="https://github.com/pgsql-jp/jpug-doc/issues/new?title=version 9.6.5 app-pg-ctl.html">誤訳等の報告</a></div></td></tr><tr><td width="10%" align="left" valign="top"><a accesskey="p" href="app-pgcontroldata.html">前へ</a> </td><td width="10%" align="left" valign="top"><a accesskey="u" href="reference-server.html">上へ</a></td><td width="60%" align="center"><span class="application">pg_ctl</span></td><td width="20%" align="right" valign="top"> <a accesskey="n" href="app-pgresetxlog.html">次へ</a></td></tr></table><hr /></div><div class="refentry" id="app-pg-ctl"><div class="titlepage"></div><a id="idm45823017151920" class="indexterm"></a><div class="refnamediv"><h2>名前</h2><p>pg_ctl<span class="original">
<refpurpose>initialize, start, stop, or control a <productname>PostgreSQL</productname> server</refpurpose>
</span> — <span class="productname">PostgreSQL</span>サーバを初期化、起動、停止、制御する</p></div><div class="refsynopsisdiv"><h2>概要</h2><div class="cmdsynopsis"><p id="idm45823017147680"><code class="command">pg_ctl</code> <code class="option">init[db]</code> [<code class="option">-s</code>] [<code class="option">-D</code> <em class="replaceable"><code>datadir</code></em>] [<code class="option">-o</code> <em class="replaceable"><code>initdb-options</code></em>]</p></div><div class="cmdsynopsis"><p id="idm45823017142272"><code class="command">pg_ctl</code> <code class="option">start</code> [<code class="option">-w</code>] [<code class="option">-t</code> <em class="replaceable"><code>seconds</code></em>] [<code class="option">-s</code>] [<code class="option">-D</code> <em class="replaceable"><code>datadir</code></em>] [<code class="option">-l</code> <em class="replaceable"><code>filename</code></em>] [<code class="option">-o</code> <em class="replaceable"><code>options</code></em>] [<code class="option">-p</code> <em class="replaceable"><code>path</code></em>] [<code class="option">-c</code>]</p></div><div class="cmdsynopsis"><p id="idm45823017131136"><code class="command">pg_ctl</code> <code class="option">stop</code> [<code class="option">-W</code>] [<code class="option">-t</code> <em class="replaceable"><code>seconds</code></em>] [<code class="option">-s</code>] [<code class="option">-D</code> <em class="replaceable"><code>datadir</code></em>] [<code class="option">-m</code>
<code class="option">s[mart]</code> | <code class="option">f[ast]</code> | <code class="option">i[mmediate]</code>
]</p></div><div class="cmdsynopsis"><p id="idm45823017120080"><code class="command">pg_ctl</code> <code class="option">restart</code> [<code class="option">-w</code>] [<code class="option">-t</code> <em class="replaceable"><code>seconds</code></em>] [<code class="option">-s</code>] [<code class="option">-D</code> <em class="replaceable"><code>datadir</code></em>] [<code class="option">-c</code>] [<code class="option">-m</code>
<code class="option">s[mart]</code> | <code class="option">f[ast]</code> | <code class="option">i[mmediate]</code>
] [<code class="option">-o</code> <em class="replaceable"><code>options</code></em>]</p></div><div class="cmdsynopsis"><p id="idm45823017106864"><code class="command">pg_ctl</code> <code class="option">reload</code> [<code class="option">-s</code>] [<code class="option">-D</code> <em class="replaceable"><code>datadir</code></em>]</p></div><div class="cmdsynopsis"><p id="idm45823017102768"><code class="command">pg_ctl</code> <code class="option">status</code> [<code class="option">-D</code> <em class="replaceable"><code>datadir</code></em>]</p></div><div class="cmdsynopsis"><p id="idm45823017099568"><code class="command">pg_ctl</code> <code class="option">promote</code> [<code class="option">-s</code>] [<code class="option">-D</code> <em class="replaceable"><code>datadir</code></em>]</p></div><div class="cmdsynopsis"><p id="idm45823017095472"><code class="command">pg_ctl</code> <code class="option">kill</code> <em class="replaceable"><code>signal_name</code></em> <em class="replaceable"><code>process_id</code></em> </p></div><div class="cmdsynopsis"><p id="idm45823017091664"><code class="command">pg_ctl</code> <code class="option">register</code> [<code class="option">-N</code> <em class="replaceable"><code>servicename</code></em>] [<code class="option">-U</code> <em class="replaceable"><code>username</code></em>] [<code class="option">-P</code> <em class="replaceable"><code>password</code></em>] [<code class="option">-D</code> <em class="replaceable"><code>datadir</code></em>] [<code class="option">-S</code>
<code class="option">a[uto]</code> | <code class="option">d[emand]</code>
] [<code class="option">-w</code>] [<code class="option">-t</code> <em class="replaceable"><code>seconds</code></em>] [<code class="option">-s</code>] [<code class="option">-o</code> <em class="replaceable"><code>options</code></em>]</p></div><div class="cmdsynopsis"><p id="idm45823017076368"><code class="command">pg_ctl</code> <code class="option">unregister</code> [<code class="option">-N</code> <em class="replaceable"><code>servicename</code></em>]</p></div></div><div class="refsect1" id="app-pg-ctl-description"><h2>説明</h2><span class="original">
<title>Description</title>
</span><p><span class="original">
<application>pg_ctl</application> is a utility for initializing a
<productname>PostgreSQL</productname> database cluster, starting,
stopping, or restarting the <productname>PostgreSQL</productname>
database server (<xref linkend="app-postgres">), or displaying the
status of a running server. Although the server can be started
manually, <application>pg_ctl</application> encapsulates tasks such
as redirecting log output and properly detaching from the terminal
and process group. It also provides convenient options for
controlled shutdown.
</span><span class="application">pg_ctl</span>は<span class="productname">PostgreSQL</span>データベースクラスタの初期化、<span class="productname">PostgreSQL</span>のデータベースサーバ(<a class="xref" href="app-postgres.html" title="postgres"><span class="refentrytitle"><span class="application">postgres</span></span></a>)を起動、停止、再起動する、あるいは稼働中のサーバの状態を表示するためのユーティリティです。
サーバは手動で起動することも可能ですが、<span class="application">pg_ctl</span>は、ログ出力のリダイレクトや、端末とプロセスグループの適切な分離などの作業を隠蔽してくれます。
さらにシャットダウン制御のための便利なオプションも提供します。
</p><p><span class="original">
The <option>init</option> or <option>initdb</option> mode creates a new
<productname>PostgreSQL</productname> database cluster. A database
cluster is a collection of databases that are managed by a single
server instance. This mode invokes the <command>initdb</command>
command. See <xref linkend="app-initdb"> for details.
</span><code class="option">init</code>または<code class="option">initdb</code>モードは<span class="productname">PostgreSQL</span>の新しいデータベースクラスタを作成します。
データベースクラスタとは、単一のサーバインスタンスで管理されるデータベースの集合です。
このモードは<code class="command">initdb</code>コマンドを呼び出します。
詳しくは<a class="xref" href="app-initdb.html" title="initdb"><span class="refentrytitle">initdb</span></a>を参照して下さい。
</p><p><span class="original">
In <option>start</option> mode, a new server is launched. The
server is started in the background, and its standard input is attached
to <filename>/dev/null</filename> (or <literal>nul</> on Windows).
On Unix-like systems, by default, the server's standard output and
standard error are sent to <application>pg_ctl</application>'s
standard output (not standard error). The standard output of
<application>pg_ctl</application> should then be redirected to a
file or piped to another process such as a log rotating program
like <application>rotatelogs</>; otherwise <command>postgres</command>
will write its output to the controlling terminal (from the
background) and will not leave the shell's process group. On
Windows, by default the server's standard output and standard error
are sent to the terminal. These default behaviors can be changed
by using <option>-l</option> to append the server's output to a log file.
Use of either <option>-l</option> or output redirection is recommended.
</span><code class="option">start</code>モードでは、新しいサーバが立ち上がります。
サーバはバックグラウンドで起動され、その標準入力は<code class="filename">/dev/null</code>(Windowsの場合は<code class="literal">nul</code>)に接続されます。
Unix系のシステムではデフォルトで、サーバの標準出力と標準エラーは<span class="application">pg_ctl</span>の標準出力に転送されます(標準エラー出力には転送されません)。
<span class="application">pg_ctl</span>の標準出力はファイルにリダイレクトするか、例えば<span class="application">rotatelogs</span>などのログローテーションプログラムのような別プロセスにパイプで渡すべきです。
こうしないと、<code class="command">postgres</code>はその出力を(バックグラウンドから)制御端末に書き出しますので、シェルのプロセスグループから切り離すことができません。
Windowsではデフォルトで、サーバの標準出力と標準エラーは端末に送信されます。
こうしたデフォルトの動作は<code class="option">-l</code>を用いてサーバの出力をログファイルに追加するように変更することができます。
<code class="option">-l</code>または出力のリダイレクトのどちらかを使用することを勧めます。
</p><p><span class="original">
In <option>stop</option> mode, the server that is running in
the specified data directory is shut down. Three different
shutdown methods can be selected with the <option>-m</option>
option. <quote>Smart</quote> mode waits for all active
clients to disconnect and any online backup to finish.
If the server is in hot standby, recovery and streaming replication
will be terminated once all clients have disconnected.
<quote>Fast</quote> mode (the default) does not wait for clients to disconnect and
will terminate an online backup in progress. All active transactions are
rolled back and clients are forcibly disconnected, then the
server is shut down. <quote>Immediate</quote> mode will abort
all server processes immediately, without a clean shutdown.
This will lead to a crash-recovery run on the next restart.
</span><code class="option">stop</code>モードは、指定されたデータディレクトリで稼働しているサーバを停止(シャットダウン)します。
<code class="option">-m</code>オプションでは、3つの異なる停止方式を選択できます。
<span class="quote">「<span class="quote">smart</span>」</span>モードは、全てのクライアントが切断し、オンラインバックアップがあればそれが終了するまで待ちます。
サーバがホットスタンバイ状態の場合、すべてのクライアント接続が切断された後にリカバリとストリーミングレプリケーションは終了します。
<span class="quote">「<span class="quote">fast</span>」</span>モード(デフォルト)はクライアントが切断するまで待たず、かつ、実行中のオンラインバックアップを終了させます。
全ての実行中のトランザクションをロールバックし、クライアントとの接続を強制的に切断した後、サーバを停止します。
<span class="quote">「<span class="quote">immediate</span>」</span>モードは、クリーンアップ処理なしで、全てのサーバプロセスを即座に中断します。
これを指定すると、再起動時にクラッシュリカバリ処理が実行されます。
</p><p><span class="original">
<option>restart</option> mode effectively executes a stop followed
by a start. This allows changing the <command>postgres</command>
command-line options. <option>restart</option> might fail if
relative paths specified were specified on the command-line during
server start.
</span><code class="option">restart</code>モードは、実質的にはstopを実行して、その後、startを実行します。
この時、<code class="command">postgres</code>コマンドラインオプションを変更することができます。
指定された相対パスがサーバ起動時にコマンドラインから指定されていた場合に <code class="option">restart</code>が失敗する可能性があります。
</p><p><span class="original">
<option>reload</option> mode simply sends the
<command>postgres</command> process a <systemitem>SIGHUP</>
signal, causing it to reread its configuration files
(<filename>postgresql.conf</filename>,
<filename>pg_hba.conf</filename>, etc.). This allows changing of
configuration-file options that do not require a complete restart
to take effect.
</span><code class="option">reload</code>モードは、単に<code class="command">postgres</code>に<span class="systemitem">SIGHUP</span>シグナルを送り、(<code class="filename">postgresql.conf</code>、<code class="filename">pg_hba.conf</code>などの)設定ファイルの再読み込みを実行させます。
これにより、設定ファイルのオプションで完全な再起動を必要としないものについて、変更を反映させることができます。
</p><p><span class="original">
<option>status</option> mode checks whether a server is running in
the specified data directory. If it is, the <acronym>PID</acronym>
and the command line options that were used to invoke it are
displayed. If the server is not running, the process returns an
exit status of 3. If an accessible data directory is not specified,
the process returns an exit status of 4.
</span><code class="option">status</code>モードは指定したデータディレクトリでサーバが稼働しているかどうかを確認します。
稼働している場合は<acronym class="acronym">PID</acronym>と、サーバを起動する時に使われたコマンドラインオプションを表示します。
サーバが稼働していない場合、このプロセスは終了ステータス3を返します。
アクセス可能なデータディレクトリが指定されていない場合、プロセスは終了ステータス4を返します。
</p><p><span class="original">
In <option>promote</option> mode, the standby server that is
running in the specified data directory is commanded to exit
recovery and begin read-write operations.
</span><code class="option">promote</code>モードでは、指定したデータディレクトリで稼動中のスタンバイサーバにリカバリを終了し読み書き操作を始めるようコマンドを送ります。
</p><p><span class="original">
<option>kill</option> mode allows you to send a signal to a specified
process. This is particularly valuable for <productname>Microsoft Windows</>
which does not have a <application>kill</> command. Use
<literal>&#045;&#045;help</> to see a list of supported signal names.
</span><code class="option">kill</code>モードでは指定したプロセスにシグナルを送信することができます。
これは特に、<span class="application">kill</span>コマンドを持たない<span class="productname">Microsoft Windows</span>で有用です。
サポートするシグナル名の一覧は<code class="literal">--help</code>を使用して確認してください。
</p><p><span class="original">
<option>register</option> mode allows you to register a system service
on <productname>Microsoft Windows</>. The <option>-S</option> option
allows selection of service start type, either <quote>auto</quote> (start
service automatically on system startup) or <quote>demand</quote> (start
service on demand).
</span><code class="option">register</code>モードにより、<span class="productname">Microsoft Windows</span>上でシステムサービスを登録することができます。
<code class="option">-S</code>オプションによりサービスの起動種類を<span class="quote">「<span class="quote">auto</span>」</span>(システム起動時に自動的にサービスを起動)か<span class="quote">「<span class="quote">demand</span>」</span>(要求が合った時にサービスを起動)から選択することができます。
</p><p><span class="original">
<option>unregister</option> mode allows you to unregister a system service
on <productname>Microsoft Windows</>. This undoes the effects of the
<option>register</option> command.
</span><code class="option">unregister</code>により<span class="productname">Microsoft Windows</span>上のシステムサービスを登録解除することができます。
これは過去に<code class="option">register</code>コマンドによりなされた変更を元に戻します。
</p></div><div class="refsect1" id="app-pg-ctl-options"><h2>オプション</h2><span class="original">
<title>Options</title>
</span><div class="variablelist"><dl class="variablelist"><dt><span class="term"><code class="option">-c</code><br /></span><span class="term"><code class="option">--core-file</code></span></dt><dd><p><span class="original">
Attempt to allow server crashes to produce core files, on platforms
where this is possible, by lifting any soft resource limit placed on
core files.
This is useful in debugging or diagnosing problems by allowing a
stack trace to be obtained from a failed server process.
</span>実現可能なプラットフォームにおいて、サーバクラッシュ時にcoreファイルを生成できるように関連するソフトリソース制限を上げます。
障害が起きたサーバプロセスからスタックトレースを取得できますので、問題のデバッグや診断の際に有用です。
</p></dd><dt><span class="term"><code class="option">-D <em class="replaceable"><code>datadir</code></em></code><br /></span><span class="term"><code class="option">--pgdata <em class="replaceable"><code>datadir</code></em></code></span></dt><dd><p><span class="original">
Specifies the file system location of the database configuration files. If
this is omitted, the environment variable
<envar>PGDATA</envar> is used.
</span>データベース設定ファイルのファイルシステム上の場所を指定します。
これが省略された場合、環境変数<code class="envar">PGDATA</code>が使われます。
</p></dd><dt><span class="term"><code class="option">-l <em class="replaceable"><code>filename</code></em></code><br /></span><span class="term"><code class="option">--log <em class="replaceable"><code>filename</code></em></code></span></dt><dd><p><span class="original">
Append the server log output to
<replaceable>filename</replaceable>. If the file does not
exist, it is created. The <systemitem>umask</> is set to 077,
so access to the log file is disallowed to other users by default.
</span>サーバログ出力を<em class="replaceable"><code>filename</code></em>に追記します。
そのファイルが存在しない場合は作成されます。
<span class="systemitem">umask</span>は077に設定されますので、他のユーザからのログファイルへのアクセスはデフォルトでは許可されません。
</p></dd><dt><span class="term"><code class="option">-m <em class="replaceable"><code>mode</code></em></code><br /></span><span class="term"><code class="option">--mode <em class="replaceable"><code>mode</code></em></code></span></dt><dd><p><span class="original">
Specifies the shutdown mode. <replaceable>mode</replaceable>
can be <literal>smart</literal>, <literal>fast</literal>, or
<literal>immediate</literal>, or the first letter of one of
these three. If this is omitted, <literal>fast</literal> is used.
</span>停止(シャットダウン)モードを指定します。
<em class="replaceable"><code>mode</code></em>は<code class="literal">smart</code>、<code class="literal">fast</code>、<code class="literal">immediate</code>、もしくはこの3つのモード名の最初の1文字をとることができます。
省略時は<code class="literal">fast</code>が使用されます。
</p></dd><dt><span class="term"><code class="option">-o <em class="replaceable"><code>options</code></em></code></span></dt><dd><p><span class="original">
Specifies options to be passed directly to the
<command>postgres</command> command; multiple
option invocations are appended.
</span><code class="command">postgres</code>に直接渡されるオプションを指定します。
複数オプションの呼び出しが追加されます。
</p><p><span class="original">
The options should usually be surrounded by single or double
quotes to ensure that they are passed through as a group.
</span>このオプションは、確実に1グループとして渡すために、通常は単一引用符または二重引用符で囲まなければなりません。
</p></dd><dt><span class="term"><code class="option">-o <em class="replaceable"><code>initdb-options</code></em></code></span></dt><dd><p><span class="original">
Specifies options to be passed directly to the
<command>initdb</command> command.
</span><code class="command">initdb</code>コマンドに直接渡すオプションを指定します。
</p><p><span class="original">
The options should usually be surrounded by single or double
quotes to ensure that they are passed through as a group.
</span>このオプションは、確実にひとまとめとして渡すために、通常は単一引用符または二重引用符で囲まなければなりません。
</p></dd><dt><span class="term"><code class="option">-p <em class="replaceable"><code>path</code></em></code></span></dt><dd><p><span class="original">
Specifies the location of the <filename>postgres</filename>
executable. By default the <filename>postgres</filename> executable is taken from the same
directory as <command>pg_ctl</command>, or failing that, the hard-wired
installation directory. It is not necessary to use this
option unless you are doing something unusual and get errors
that the <filename>postgres</filename> executable was not found.
</span><code class="filename">postgres</code>の実行プログラムの位置を指定します。
デフォルトでは<code class="filename">postgres</code>の実行プログラムは<code class="command">pg_ctl</code>と同じディレクトリにあるものとみなされます。また、このディレクトリに存在しなければ、構築時に指定したインストールディレクトリが使われます。
このオプションは、何か異例なことをしていて<code class="filename">postgres</code>が見つからないというようなエラーが出ない限り、使う必要はありません。
</p><p><span class="original">
In <literal>init</literal> mode, this option analogously
specifies the location of the <filename>initdb</filename>
executable.
</span><code class="literal">init</code>モードでは、このオプションは同様に<code class="filename">initdb</code>実行プログラムの場所を指定します。
</p></dd><dt><span class="term"><code class="option">-s</code><br /></span><span class="term"><code class="option">--silent</code></span></dt><dd><p><span class="original">
Print only errors, no informational messages.
</span>エラーメッセージのみを表示し、その他の情報を表示しません。
</p></dd><dt><span class="term"><code class="option">-t</code><br /></span><span class="term"><code class="option">--timeout</code></span></dt><dd><p><span class="original">
The maximum number of seconds to wait when waiting for startup or
shutdown to complete. Defaults to the value of the
<envar>PGCTLTIMEOUT</> environment variable or, if not set, to 60
seconds.
</span>起動または停止の完了まで待機する最大の秒数。
デフォルトは環境変数<code class="envar">PGCTLTIMEOUT</code>の値で、それが設定されていなければ60秒です。
</p></dd><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>pg_ctl</application> version and exit.
</span><span class="application">pg_ctl</span>のバージョンを表示し、終了します。
</p></dd><dt><span class="term"><code class="option">-w</code></span></dt><dd><p><span class="original">
Wait for the startup or shutdown to complete.
Waiting is the default option for shutdowns, but not startups.
When waiting for startup, <command>pg_ctl</command> repeatedly
attempts to connect to the server.
When waiting for shutdown, <command>pg_ctl</command> waits for
the server to remove its <acronym>PID</acronym> file.
This option allows the entry of an <acronym>SSL</> passphrase on startup.
<command>pg_ctl</command> returns an exit code based on the
success of the startup or shutdown.
</span>起動もしくは停止処理が完了するのを待ちます。
待機は停止処理ではデフォルトのオプションですが、起動処理ではデフォルトではありません。
起動処理を待機している場合、<code class="command">pg_ctl</code>は繰り返しサーバへの接続を試行します。
停止処理を待機している場合、<code class="command">pg_ctl</code>はサーバが<acronym class="acronym">PID</acronym>ファイルを削除するまで待機します。
このオプションにより起動時に<acronym class="acronym">SSL</acronym>パスフレーズを入力することができます。
<code class="command">pg_ctl</code>は、起動もしくは停止が成功したかどうかに基づいて終了コードを返します。
</p></dd><dt><span class="term"><code class="option">-W</code></span></dt><dd><p><span class="original">
Do not wait for startup or shutdown to complete. This is the
default for start and restart modes.
</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>pg_ctl</application> command line
arguments, and exit.
</span><span class="application">pg_ctl</span>コマンドライン引数の説明を表示し、終了します。
</p></dd></dl></div><div class="refsect2" id="app-pg-ctl-windows-options"><h3>Windows用オプション</h3><span class="original">
<title>Options for Windows</title>
</span><div class="variablelist"><dl class="variablelist"><dt><span class="term"><code class="option">-e <em class="replaceable"><code>source</code></em></code></span></dt><dd><p><span class="original">
Name of the event source for <application>pg_ctl</application> to use
for logging to the event log when running as a Windows service. The
default is <literal>PostgreSQL</literal>. Note that this only controls
the logging from <application>pg_ctl</application> itself; once
started, the server will use the event source specified
by <xref linkend="guc-event-source">. Should the server fail during
early startup, it might also log using the default event
source <literal>PostgreSQL</literal>.
</span>Windowsのサービスとして実行する際に、イベントログへの出力用に<span class="application">pg_ctl</span>が使用するイベントソースの名前です。
デフォルトは<code class="literal">PostgreSQL</code>です。
これは<span class="application">pg_ctl</span>自体からのログ出力のみを制御することに注意してください。
サーバが起動した後は、<a class="xref" href="runtime-config-logging.html#guc-event-source">event_source</a>で指定したイベントソースが使用されます。
サーバが起動の初期で障害を起こした場合は、デフォルトのイベントソースの<code class="literal">PostgreSQL</code>を使用するかもしれません。
</p></dd><dt><span class="term"><code class="option">-N <em class="replaceable"><code>servicename</code></em></code></span></dt><dd><p><span class="original">
Name of the system service to register. The name will be used
as both the service name and the display name.
</span>登録するシステムサービスの名前です。
この名前は、システム名としても表示名としても使用されます。
</p></dd><dt><span class="term"><code class="option">-P <em class="replaceable"><code>password</code></em></code></span></dt><dd><p><span class="original">
Password for the user to start the service.
</span>サービスを開始するユーザ用のパスワードです。
</p></dd><dt><span class="term"><code class="option">-S <em class="replaceable"><code>start-type</code></em></code></span></dt><dd><p><span class="original">
Start type of the system service to register. start-type can
be <literal>auto</literal>, or <literal>demand</literal>, or
the first letter of one of these two. If this is omitted,
<literal>auto</literal> is used.
</span>登録するシステムサービスの起動種類です。
起動種類は<code class="literal">auto</code>、<code class="literal">demand</code>、またはこれら2単語の先頭の文字のいずれかです。
省略時は<code class="literal">auto</code>が使用されます。
</p></dd><dt><span class="term"><code class="option">-U <em class="replaceable"><code>username</code></em></code></span></dt><dd><p><span class="original">
User name for the user to start the service. For domain users, use the
format <literal>DOMAIN\username</literal>.
</span>サービスを起動するユーザのユーザ名です。
ドメインユーザの場合は<code class="literal">DOMAIN\username</code>書式を使用してください。
</p></dd></dl></div></div></div><div class="refsect1" id="idm45823016967040"><h2>環境</h2><span class="original">
<title>Environment</title>
</span><div class="variablelist"><dl class="variablelist"><dt><span class="term"><code class="envar">PGCTLTIMEOUT</code></span></dt><dd><p><span class="original">
Default limit on the number of seconds to wait when waiting for startup
or shutdown to complete. If not set, the default is 60 seconds.
</span>起動または終了が完了するまでに待機する秒数のデフォルトの最大値です。
設定されていない場合のデフォルトは60秒です。
</p></dd><dt><span class="term"><code class="envar">PGDATA</code></span></dt><dd><p><span class="original">
Default data directory location.
</span>デフォルトのデータディレクトリの場所です。
</p></dd></dl></div><p><span class="original">
<command>pg_ctl</command>, like most other <productname>PostgreSQL</>
utilities,
also uses the environment variables supported by <application>libpq</>
(see <xref linkend="libpq-envars">).
For additional server variables, see <xref linkend="app-postgres">.
</span>また、<code class="command">pg_ctl</code>は、他のほとんどの<span class="productname">PostgreSQL</span>ユーティリティと同様、<span class="application">libpq</span>でサポートされる環境変数を使用します(<a class="xref" href="libpq-envars.html" title="32.14. 環境変数">32.14. 環境変数</a>を参照してください)。
この他のサーバ変数については<a class="xref" href="app-postgres.html" title="postgres"><span class="refentrytitle"><span class="application">postgres</span></span></a>を参照してください。
</p></div><div class="refsect1" id="idm45823016959232"><h2>ファイル</h2><span class="original">
<title>Files</title>
</span><div class="variablelist"><dl class="variablelist"><dt><span class="term"><code class="filename">postmaster.pid</code></span></dt><dd><p><span class="original">
The existence of this file in the data directory is used to help
<application>pg_ctl</application> determine if the server is
currently running.
</span>データディレクトリにこのファイルがあるかどうかによって、<span class="application">pg_ctl</span>はサーバが現在稼働中かどうかを決定します。
</p></dd><dt><span class="term"><code class="filename">postmaster.opts</code></span></dt><dd><span class="original">
<para>If this file exists in the data directory,
<application>pg_ctl</application> (in <option>restart</option> mode)
will pass the contents of the file as options to
<application>postgres</application>, unless overridden
by the <option>-o</option> option. The contents of this file
are also displayed in <option>status</option> mode.
</span><p>このファイルがデータディレクトリにあれば、<span class="application">pg_ctl</span>(の<code class="option">restart</code>モード)は、<code class="option">-o</code>で上書きされるものを除き、このファイルの内容をオプションとして<code class="command">postgres</code>に渡します。
また、このファイルの内容が<code class="option">status</code>モードで表示されます。
</p></dd></dl></div></div><div class="refsect1" id="r1-app-pgctl-2"><h2>例</h2><span class="original">
<title>Examples</title>
</span><div class="refsect2" id="r2-app-pgctl-3"><h3>サーバの起動</h3><span class="original">
<title>Starting the Server</title>
</span><p><span class="original">
To start the server:
</span>サーバを起動します。
</p><pre class="screen"><code class="prompt">$</code> <strong class="userinput"><code>pg_ctl start</code></strong></pre><p>
</p><p><span class="original">
To start the server, waiting until the server is
accepting connections:
</span>以下はサーバが接続を植え付けられるようになるまで待機する起動例です。
</p><pre class="screen"><code class="prompt">$</code> <strong class="userinput"><code>pg_ctl -w start</code></strong></pre><p>
</p><p><span class="original">
To start the server using port 5433, and
running without <function>fsync</function>, use:
</span>ポート5433を使い<code class="function">fsync</code>なしでサーバを起動します。
</p><pre class="screen"><code class="prompt">$</code> <strong class="userinput"><code>pg_ctl -o "-F -p 5433" start</code></strong></pre></div><div class="refsect2" id="r2-app-pgctl-4"><h3>サーバの停止</h3><span class="original">
<title>Stopping the Server</title>
</span><p><span class="original">
To stop the server, use:
</span>サーバを停止するためには以下を使用します。
</p><pre class="screen"><code class="prompt">$</code> <strong class="userinput"><code>pg_ctl stop</code></strong></pre><p><span class="original">
The <option>-m</option> option allows control over
<emphasis>how</emphasis> the server shuts down:
</span>
<code class="option">-m</code>オプションにより<span class="emphasis"><em>どのように</em></span>バックエンドを停止させるかを制御できます。
</p><pre class="screen"><code class="prompt">$</code> <strong class="userinput"><code>pg_ctl stop -m fast</code></strong></pre></div><div class="refsect2" id="r2-app-pgctl-5"><h3>サーバの再起動</h3><span class="original">
<title>Restarting the Server</title>
</span><p><span class="original">
Restarting the server is almost equivalent to stopping the
server and starting it again,
except that <command>pg_ctl</command> saves and reuses the command line options that
were passed to the previously running instance. To restart
the server in the simplest form, use:
</span>サーバの再起動は、サーバを停止してもう一度起動するのとほぼ同じですが、違うのは、<code class="command">pg_ctl</code>が以前起動していたインスタンスに渡されていたコマンドラインオプションを保存し再利用することです。
下記はサーバを再起動する最も簡単な方法です。
</p><pre class="screen"><code class="prompt">$</code> <strong class="userinput"><code>pg_ctl restart</code></strong></pre><p>
</p><p><span class="original">
To restart the server,
waiting for it to shut down and restart:
</span>再起動の際にサーバのシャットダウンを待ってから起動を行う方法です。
</p><pre class="screen"><code class="prompt">$</code> <strong class="userinput"><code>pg_ctl -w restart</code></strong></pre><p>
</p><p><span class="original">
To restart using port 5433, disabling <function>fsync</> upon restart:
</span>以下はポート5433を使って再起動し、再起動後に<code class="function">fsync</code>を無効にする方法です。
</p><pre class="screen"><code class="prompt">$</code> <strong class="userinput"><code>pg_ctl -o "-F -p 5433" restart</code></strong></pre></div><div class="refsect2" id="r2-app-pgctl-6"><h3>サーバの状態表示</h3><span class="original">
<title>Showing the Server Status</title>
</span><p><span class="original">
Here is sample status output from
<application>pg_ctl</application>:
</span>下記は<span class="application">pg_ctl</span>からの状態の出力の例です。
</p><pre class="screen"><code class="prompt">$</code> <strong class="userinput"><code>pg_ctl status</code></strong>
<code class="computeroutput">pg_ctl: server is running (PID: 13718)
/usr/local/pgsql/bin/postgres "-D" "/usr/local/pgsql/data" "-p" "5433" "-B" "128"</code></pre><p><span class="original">
This is the command line that would be invoked in restart mode.
</span>
これは再起動(restart)モードで呼び出されるコマンドラインです。
</p></div></div><div class="refsect1" id="idm45823016920560"><h2>関連項目</h2><span class="original">
<title>See Also</title>
</span><span class="simplelist"><a class="xref" href="app-initdb.html" title="initdb"><span class="refentrytitle">initdb</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 class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="app-pgcontroldata.html">前へ</a> </td><td width="20%" align="center"><a accesskey="u" href="reference-server.html">上へ</a></td><td width="40%" align="right"> <a accesskey="n" href="app-pgresetxlog.html">次へ</a></td></tr><tr><td width="40%" align="left" valign="top"><span class="application">pg_controldata</span> </td><td width="20%" align="center"><a accesskey="h" href="index.html">ホーム</a></td><td width="40%" align="right" valign="top"> <span class="application">pg_resetxlog</span></td></tr></table></div></body></html>