-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp-pgreceivewal.html
More file actions
470 lines (467 loc) · 41.5 KB
/
app-pgreceivewal.html
File metadata and controls
470 lines (467 loc) · 41.5 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
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
<?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_receivewal</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="app-pg-isready.html" title="pg_isready" /><link rel="next" href="app-pgrecvlogical.html" title="pg_recvlogical" /><meta name="viewport" content="width=device-width,initial-scale=1.0" /></head><body id="docContent" class="container-fluid col-10"><div class="other_version"><a href="https://www.postgresql.jp/document/">バージョンごとのドキュメント一覧</a></div><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="4" align="center"><a accesskey="h" href="index.html">PostgreSQL 18.3文書</a></th></tr><tr><td width="10%" align="left"></td><td width="10%" align="left"></td><td width="60%" align="center"><a href="reference-client.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 18.3 : app-pgreceivewal.html">誤訳等の報告
</a></div></td></tr><tr><td width="10%" align="left"><a accesskey="p" href="app-pg-isready.html" title="pg_isready">前へ</a> </td><td width="10%" align="left"><a accesskey="u" href="reference-client.html" title="PostgreSQLクライアントアプリケーション">上へ</a></td><td width="60%" align="center"><span class="application">pg_receivewal</span></td><td width="20%" align="right"> <a accesskey="n" href="app-pgrecvlogical.html" title="pg_recvlogical">次へ</a></td></tr></table><hr /></div><div class="refentry" id="APP-PGRECEIVEWAL"><div class="titlepage"></div><a id="id-1.9.4.17.1" class="indexterm"></a><div class="refnamediv"><h2><span class="refentrytitle"><span class="application">pg_receivewal</span></span></h2><p>pg_receivewal<span class="original">
<refpurpose>stream write-ahead logs from a <productname>PostgreSQL</productname> server</refpurpose>
</span> — <span class="productname">PostgreSQL</span>サーバから先行書き込みログ(WAL)をストリームする</p></div><div class="refsynopsisdiv"><h2>概要</h2><div class="cmdsynopsis"><p id="id-1.9.4.17.4.1"><code class="command">pg_receivewal</code> [<em class="replaceable"><code>option</code></em>...]</p></div></div><div class="refsect1" id="id-1.9.4.17.5"><h2>説明</h2><span class="original">
<title>Description</title>
</span><p>
<span class="original">
<application>pg_receivewal</application> is used to stream the write-ahead log
from a running <productname>PostgreSQL</productname> cluster. The write-ahead
log is streamed using the streaming replication protocol, and is written
to a local directory of files. This directory can be used as the archive
location for doing a restore using point-in-time recovery (see
<xref linkend="continuous-archiving"/>).
</span>
<span class="application">pg_receivewal</span>は実行中の<span class="productname">PostgreSQL</span>クラスタから先行書き込みログ(WAL)をストリームするために使用されます。
先行書き込みログ(WAL)はストリーミングレプリケーションプロトコルを使用してストリームされ、ローカルディレクトリのファイルとして書き出されます。
このディレクトリはポイントインタイムリカバリ(<a class="xref" href="continuous-archiving.html" title="25.3. 継続的アーカイブとポイントインタイムリカバリ(PITR)">25.3</a>参照)を用いてリストアする際のアーカイブ場所として使用することができます。
</p><p>
<span class="original">
<application>pg_receivewal</application> streams the write-ahead
log in real time as it's being generated on the server, and does not wait
for segments to complete like <xref linkend="guc-archive-command"/> and
<xref linkend="guc-archive-library"/> do.
For this reason, it is not necessary to set
<xref linkend="guc-archive-timeout"/> when using
<application>pg_receivewal</application>.
</span>
<span class="application">pg_receivewal</span>は、先行書き込みログ(WAL)をサーバでの生成に合わせてリアルタイムでストリームし、<a class="xref" href="runtime-config-wal.html#GUC-ARCHIVE-COMMAND">archive_command</a>や<a class="xref" href="runtime-config-wal.html#GUC-ARCHIVE-LIBRARY">archive_library</a>とは異なり、セグメントが完了するまで待機することはありません。
このため、<span class="application">pg_receivewal</span>を使用する場合には<a class="xref" href="runtime-config-wal.html#GUC-ARCHIVE-TIMEOUT">archive_timeout</a>を設定する必要はありません。
</p><p>
<span class="original">
Unlike the WAL receiver of a PostgreSQL standby server, <application>pg_receivewal</application>
by default flushes WAL data only when a WAL file is closed.
The option <option>&#45;-synchronous</option> must be specified to flush WAL data
in real time. Since <application>pg_receivewal</application> does not
apply WAL, you should not allow it to become a synchronous standby when
<xref linkend="guc-synchronous-commit"/> equals
<literal>remote_apply</literal>. If it does, it will appear to be a
standby that never catches up, and will cause transaction commits to
block. To avoid this, you should either configure an appropriate value
for <xref linkend="guc-synchronous-standby-names"/>, or specify
<varname>application_name</varname> for
<application>pg_receivewal</application> that does not match it, or
change the value of <varname>synchronous_commit</varname> to
something other than <literal>remote_apply</literal>.
</span>
PostgreSQLのスタンバイサーバのWALレシーバと異なり、<span class="application">pg_receivewal</span>はデフォルトでは、WALファイルがクローズされた時にのみ、WALデータをフラッシュします。
WALデータをリアルタイムでフラッシュするには<code class="option">--synchronous</code>オプションを指定する必要があります。
<span class="application">pg_receivewal</span>はWALを適用しないので、<a class="xref" href="runtime-config-wal.html#GUC-SYNCHRONOUS-COMMIT">synchronous_commit</a>が<code class="literal">remote_apply</code>のときにこれを同期スタンバイにすることはできません。
そのようにした場合、決してキャッチアップすることのないスタンバイになり、トランザクションコミットのブロックをひき起こします。
これを避けるには、<a class="xref" href="runtime-config-replication.html#GUC-SYNCHRONOUS-STANDBY-NAMES">synchronous_standby_names</a>に適切な値を設定するか、<span class="application">pg_receivewal</span>に対して一致しない<code class="varname">application_name</code>を指定する、あるいは、<code class="varname">synchronous_commit</code>の値を<code class="literal">remote_apply</code>以外の値に変更してください。
</p><p>
<span class="original">
The write-ahead log is streamed over a regular
<productname>PostgreSQL</productname> connection and uses the replication
protocol. The connection must be made with a user having
<literal>REPLICATION</literal> permissions (see
<xref linkend="role-attributes"/>) or a superuser, and
<filename>pg_hba.conf</filename> must permit the replication connection.
The server must also be configured with
<xref linkend="guc-max-wal-senders"/> set high enough to leave at least
one session available for the stream.
</span>
先行書き込みログ(WAL)は通常の<span class="productname">PostgreSQL</span>接続を経由して、そしてレプリケーションプロトコルを使用して、ストリームされます。
この接続は<code class="literal">REPLICATION</code>権限(<a class="xref" href="role-attributes.html" title="21.2. ロールの属性">21.2</a>参照)を持つユーザまたはスーパーユーザによって確立されなければなりません。
そして<code class="filename">pg_hba.conf</code>でレプリケーション用の接続を許可しなければなりません。
またサーバではストリーム用に利用できるセッションが少なくとも1つ存在できるために<a class="xref" href="runtime-config-replication.html#GUC-MAX-WAL-SENDERS">max_wal_senders</a>を十分大きく設定しなければなりません。
</p><p>
<span class="original">
The starting point of the write-ahead log streaming is calculated when
<application>pg_receivewal</application> starts:
</span>
先行書き込みログ(WAL)のストリーミングの開始点は<span class="application">pg_receivewal</span>の開始時に以下のように計算されます。
</p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p>
<span class="original">
First, scan the directory where the WAL segment files are written and
find the newest completed segment file, using as the starting point the
beginning of the next WAL segment file.
</span>
まず、WALセグメントファイルが書き込まれるディレクトリをスキャンして、最新の完了したセグメントファイルを見つけ、次のWALセグメントファイルの始まりを開始点として使います。
</p></li><li class="listitem"><p>
<span class="original">
If a starting point cannot be calculated with the previous method,
and if a replication slot is used, an extra
<command>READ_REPLICATION_SLOT</command> command is issued to retrieve
the slot's <literal>restart_lsn</literal> to use as the starting point.
This option is only available when streaming write-ahead logs from
<productname>PostgreSQL</productname> 15 and up.
</span>
前の方法で開始点を計算できず、レプリケーションスロットが使用されている場合、追加の<code class="command">READ_REPLICATION_SLOT</code>コマンドを発行してスロットの<code class="literal">restart_lsn</code>を取得し、開始点として使用します。
このオプションは、<span class="productname">PostgreSQL</span> 15以降から先行書き込みログ(WAL)をストリーミングする場合にのみ使用できます。
</p></li><li class="listitem"><p>
<span class="original">
If a starting point cannot be calculated with the previous method,
the latest WAL flush location is used as reported by the server from
an <literal>IDENTIFY_SYSTEM</literal> command.
</span>
開始点が前の方法で計算できなければ、サーバの<code class="literal">IDENTIFY_SYSTEM</code>コマンドで報告された最新のWALのフラッシュ位置が使われます。
</p></li></ol></div><p>
</p><p>
<span class="original">
If the connection is lost, or if it cannot be initially established,
with a non-fatal error, <application>pg_receivewal</application> will
retry the connection indefinitely, and reestablish streaming as soon
as possible. To avoid this behavior, use the <literal>-n</literal>
parameter.
</span>
接続が失われた場合、または、致命的ではないエラーで初期確立ができなかった場合、<span class="application">pg_receivewal</span>は無期限に接続を再試行しできるだけ早くストリーミングを再確立します。
この動作を止めるためには<code class="literal">-n</code>パラメータを使用してください。
</p><p>
<span class="original">
In the absence of fatal errors, <application>pg_receivewal</application>
will run until terminated by the <systemitem>SIGINT</systemitem>
(<keycombo action="simul"><keycap>Control</keycap><keycap>C</keycap></keycombo>)
or <systemitem>SIGTERM</systemitem> signal.
</span>
致命的なエラーが無い場合、<span class="application">pg_receivewal</span>は<span class="systemitem">SIGINT</span>(<span class="keycap"><strong>Control</strong></span>+<span class="keycap"><strong>C</strong></span>)または<span class="systemitem">SIGTERM</span>シグナルで停止されるまで実行を続けます。
</p></div><div class="refsect1" id="id-1.9.4.17.6"><h2>オプション</h2><span class="original">
<title>Options</title>
</span><div class="variablelist"><dl class="variablelist"><dt><span class="term"><code class="option">-D <em class="replaceable"><code>directory</code></em></code><br /></span><span class="term"><code class="option">--directory=<em class="replaceable"><code>directory</code></em></code></span></dt><dd><p>
<span class="original">
Directory to write the output to.
</span>
出力を書き出すディレクトリです。
</p><p>
<span class="original">
This parameter is required.
</span>
このパラメータは必須です。
</p></dd><dt><span class="term"><code class="option">-E <em class="replaceable"><code>lsn</code></em></code><br /></span><span class="term"><code class="option">--endpos=<em class="replaceable"><code>lsn</code></em></code></span></dt><dd><p>
<span class="original">
Automatically stop replication and exit with normal exit status 0 when
receiving reaches the specified LSN.
</span>
受信が指定したLSNに達したなら、自動的にレプリケーションを停止して、通常の終了ステータス0で終了します。
</p><p>
<span class="original">
If there is a record with LSN exactly equal to <replaceable>lsn</replaceable>,
the record will be processed.
</span>
<em class="replaceable"><code>lsn</code></em>とちょうど等しいLSNのレコードがある場合、そのレコードは処理されます。
</p></dd><dt><span class="term"><code class="option">--if-not-exists</code></span></dt><dd><p>
<span class="original">
Do not error out when <option>&#45;-create-slot</option> is specified
and a slot with the specified name already exists.
</span>
<code class="option">--create-slot</code>が指定され、指定された名前のスロットが既に存在していた場合に、エラーを発生させません。
</p></dd><dt><span class="term"><code class="option">-n</code><br /></span><span class="term"><code class="option">--no-loop</code></span></dt><dd><p>
<span class="original">
Don't loop on connection errors. Instead, exit right away with
an error.
</span>
接続エラー時に繰り返しません。
代わりにエラーですぐに終了します。
</p></dd><dt><span class="term"><code class="option">--no-sync</code></span></dt><dd><p>
<span class="original">
This option causes <command>pg_receivewal</command> to not force WAL
data to be flushed to disk. This is faster, but means that a
subsequent operating system crash can leave the WAL segments corrupt.
Generally, this option is useful for testing but should not be used
when doing WAL archiving on a production deployment.
</span>
このオプションは<code class="command">pg_receivewal</code>がWALデータをディスクに強制的にフラッシュさせないようにします。
これはより高速ですが、オペレーションシステムのクラッシュ後にWALセグメントが破損している可能性があります。
一般に、このオプションはテストには有益ですが、本番配備でWALのアーカイビングを行うときに使うべきではありません。
</p><p>
<span class="original">
This option is incompatible with <literal>&#45;-synchronous</literal>.
</span>
このオプションは<code class="literal">--synchronous</code>と両立しません。
</p></dd><dt><span class="term"><code class="option">-s <em class="replaceable"><code>interval</code></em></code><br /></span><span class="term"><code class="option">--status-interval=<em class="replaceable"><code>interval</code></em></code></span></dt><dd><p>
<span class="original">
Specifies the number of seconds between status packets sent back to the
server. This allows for easier monitoring of the progress from server.
A value of zero disables the periodic status updates completely,
although an update will still be sent when requested by the server, to
avoid timeout disconnect. The default value is 10 seconds.
</span>
サーバに状態パケットを返答する間隔を秒単位で指定します。
これによりサーバからより簡単に進行状況を監視することができます。
ゼロという値は状態の定期的な更新を完全に無効にします。
しかしタイムアウトによる切断を防ぐために、サーバから要求された時には更新を送信します。
デフォルト値は10秒です。
</p></dd><dt><span class="term"><code class="option">-S <em class="replaceable"><code>slotname</code></em></code><br /></span><span class="term"><code class="option">--slot=<em class="replaceable"><code>slotname</code></em></code></span></dt><dd><p>
<span class="original">
Require <application>pg_receivewal</application> to use an existing
replication slot (see <xref linkend="streaming-replication-slots"/>).
When this option is used, <application>pg_receivewal</application> will report
a flush position to the server, indicating when each segment has been
synchronized to disk so that the server can remove that segment if it
is not otherwise needed.
</span>
<span class="application">pg_receivewal</span>が既存のレプリケーションスロットを使うようにします(<a class="xref" href="warm-standby.html#STREAMING-REPLICATION-SLOTS" title="26.2.6. レプリケーションスロット">26.2.6</a>を参照してください)。
このオプションが使われると、<span class="application">pg_receivewal</span>はフラッシュ位置をサーバに報告します。
これは、各セグメントがいつディスクに同期されたかを示し、それによりサーバが必要のなくなったセグメントを削除できるようになります。
</p><p>
<span class="original">
When the replication client
of <application>pg_receivewal</application> is configured on the
server as a synchronous standby, then using a replication slot will
report the flush position to the server, but only when a WAL file is
closed. Therefore, that configuration will cause transactions on the
primary to wait for a long time and effectively not work
satisfactorily. The option <literal>&#45;-synchronous</literal> (see
below) must be specified in addition to make this work correctly.
</span>
<span class="application">pg_receivewal</span>のレプリケーションクライアントが同期スタンバイとしてサーバ上で構成されている場合、レプリケーションスロットを利用するとフラッシュ位置がサーバに報告されますが、それはWALファイルがクローズされる時のみです。
したがって、その構成ではプライマリ上のトランザクションが長時間待たされることになり、結果的に満足する動作を得られません。
これを正しく動作させるには、追加で<code class="literal">--synchronous</code>オプション(以下を参照)を指定する必要があります。
</p></dd><dt><span class="term"><code class="option">--synchronous</code></span></dt><dd><p>
<span class="original">
Flush the WAL data to disk immediately after it has been received. Also
send a status packet back to the server immediately after flushing,
regardless of <literal>&#45;-status-interval</literal>.
</span>
WALデータを受け取ると即座にディスクにフラッシュします。
またフラッシュした直後に、<code class="literal">--status-interval</code>の値が何であれ、ステータスパケットをサーバに送り返します。
</p><p>
<span class="original">
This option should be specified if the replication client
of <application>pg_receivewal</application> is configured on the
server as a synchronous standby, to ensure that timely feedback is
sent to the server.
</span>
<span class="application">pg_receivewal</span>のレプリケーションクライアントが同期スタンバイとしてサーバ上で構成されている場合、フィードバックが遅延なくサーバに送り返されることを確実にするため、このオプションを指定すべきです。
</p></dd><dt><span class="term"><code class="option">-v</code><br /></span><span class="term"><code class="option">--verbose</code></span></dt><dd><p>
<span class="original">
Enables verbose mode.
</span>
冗長モードを有効にします。
</p></dd><dt><span class="term"><code class="option">-Z <em class="replaceable"><code>level</code></em></code><br /></span><span class="term"><code class="option">-Z <em class="replaceable"><code>method</code></em>[:<em class="replaceable"><code>detail</code></em>]</code><br /></span><span class="term"><code class="option">--compress=<em class="replaceable"><code>level</code></em></code><br /></span><span class="term"><code class="option">--compress=<em class="replaceable"><code>method</code></em>[:<em class="replaceable"><code>detail</code></em>]</code></span></dt><dd><p>
<span class="original">
Enables compression of write-ahead logs.
</span>
先行書き込みログ(WAL)の圧縮を有効にします。
</p><p>
<span class="original">
The compression method can be set to <literal>gzip</literal>,
<literal>lz4</literal> (if <productname>PostgreSQL</productname>
was compiled with <option>&#45;-with-lz4</option>) or
<literal>none</literal> for no compression.
A compression detail string can optionally be specified. If the
detail string is an integer, it specifies the compression level.
Otherwise, it should be a comma-separated list of items, each of the
form <replaceable>keyword</replaceable> or
<replaceable>keyword=value</replaceable>.
Currently, the only supported keyword is <literal>level</literal>.
</span>
圧縮方式は<code class="literal">gzip</code>、(<span class="productname">PostgreSQL</span>が<code class="option">--with-lz4</code>でコンパイルされた場合)<code class="literal">lz4</code>に設定できます。非圧縮の場合は<code class="literal">none</code>です。
圧縮の詳細文字列はオプションで指定できます。
詳細文字列が整数の場合は、圧縮レベルを指定します。
それ以外の場合は、<em class="replaceable"><code>keyword</code></em>または<em class="replaceable"><code>keyword=value</code></em>の形式のカンマで区切られた項目リストにします。
現在サポートされているキーワードは<code class="literal">level</code>のみです。
</p><p>
<span class="original">
If no compression level is specified, the default compression level
will be used. If only a level is specified without mentioning an
algorithm, <literal>gzip</literal> compression will be used if the
level is greater than 0, and no compression will be used if the level
is 0.
</span>
圧縮レベルが指定されていない場合、デフォルトの圧縮レベルが使用されます。
アルゴリズムを指定せずにレベルのみが指定されている場合、レベルが0より大きい場合は<code class="literal">gzip</code>圧縮が使用され、レベルが0の場合は圧縮が使用されません。
</p><p>
<span class="original">
The suffix <filename>.gz</filename> will automatically be added to
all filenames when using <literal>gzip</literal>, and the suffix
<filename>.lz4</filename> is added when using <literal>lz4</literal>.
</span>
<code class="literal">gzip</code>を使用している場合は、すべてのファイル名に自動的に接尾辞<code class="filename">.gz</code>が追加されます。<code class="literal">lz4</code>を使用している場合は、接尾辞<code class="filename">.lz4</code>が追加されます。
</p></dd></dl></div><p>
<span class="original">
The following command-line options control the database connection parameters.
</span>
以下のコマンドラインオプションはデータベース接続パラメータを制御します。
</p><div class="variablelist"><dl class="variablelist"><dt><span class="term"><code class="option">-d <em class="replaceable"><code>connstr</code></em></code><br /></span><span class="term"><code class="option">--dbname=<em class="replaceable"><code>connstr</code></em></code></span></dt><dd><p>
<span class="original">
Specifies parameters used to connect to the server, as a <link
linkend="libpq-connstring">connection string</link>; these
will override any conflicting command line options.
</span>
サーバに接続するために使用するパラメータを、<a class="link" href="libpq-connect.html#LIBPQ-CONNSTRING" title="32.1.1. 接続文字列">接続文字列</a>として指定します。
これは衝突するコマンドラインオプションよりも優先します。
</p><p>
<span class="original">
This option is called <literal>&#45;-dbname</literal> for consistency with other
client applications, but because <application>pg_receivewal</application>
doesn't connect to any particular database in the cluster, any database
name included in the connection string will be ignored by the server.
However, a database name supplied that way overrides the default
database name (<literal>replication</literal>) for purposes of
looking up the replication connection's password
in <filename>~/.pgpass</filename>. Similarly, middleware or proxies
used in connecting to <productname>PostgreSQL</productname> might
utilize the name for purposes such as connection routing.
</span>
このオプションは他のクライアントアプリケーションとの整合性のために<code class="literal">--dbname</code>と呼ばれます。しかし、<span class="application">pg_receivewal</span>はクラスタ内のどの特定のデータベースにも接続しませんので、接続文字列に含まれるデータベース名はサーバにより無視されます。
しかし、そのようにして提供されたデータベース名は、レプリケーション接続のパスワードを<code class="filename">~/.pgpass</code>で検索するためのデフォルトのデータベース名(<code class="literal">replication</code>)を上書きします。
同様に、<span class="productname">PostgreSQL</span>への接続に使用されるミドルウェアやプロキシは、接続ルーティングなどのために、この名前を利用する可能性があります。
</p></dd><dt><span class="term"><code class="option">-h <em class="replaceable"><code>host</code></em></code><br /></span><span class="term"><code class="option">--host=<em class="replaceable"><code>host</code></em></code></span></dt><dd><p>
<span class="original">
Specifies the host name of the machine on which the server is
running. If the value begins with a slash, it is used as the
directory for the Unix domain socket. The default is taken
from the <envar>PGHOST</envar> environment variable, if set,
else a Unix domain socket connection is attempted.
</span>
サーバが稼働しているマシンのホスト名を指定します。
この値がスラッシュから始まる場合、Unixドメインソケット用のディレクトリとして使用されます。
デフォルトは、設定されていれば環境変数<code class="envar">PGHOST</code>から取得されます。
設定されていなければ、Unixドメインソケット接続とみなされます。
</p></dd><dt><span class="term"><code class="option">-p <em class="replaceable"><code>port</code></em></code><br /></span><span class="term"><code class="option">--port=<em class="replaceable"><code>port</code></em></code></span></dt><dd><p>
<span class="original">
Specifies the TCP port or local Unix domain socket file
extension on which the server is listening for connections.
Defaults to the <envar>PGPORT</envar> environment variable, if
set, or a compiled-in default.
</span>
サーバが接続を監視するTCPポートもしくはローカルUnixドメインソケットファイルの拡張子を指定します。
デフォルトは、設定されている場合、環境変数<code class="envar">PGPORT</code>の値となります。設定されていなければ、コンパイル時のデフォルト値となります。
</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">
User name to connect as.
</span>
接続するユーザ名です。
</p></dd><dt><span class="term"><code class="option">-w</code><br /></span><span class="term"><code class="option">--no-password</code></span></dt><dd><p>
<span class="original">
Never issue a password prompt. If the server requires
password authentication and a password is not available by
other means such as a <filename>.pgpass</filename> file, the
connection attempt will fail. This option can be useful in
batch jobs and scripts where no user is present to enter a
password.
</span>
パスワードの入力を促しません。
サーバがパスワード認証を必要とし、かつ、<code class="filename">.pgpass</code>ファイルなどの他の方法が利用できない場合、接続試行は失敗します。
バッチジョブやスクリプトなどパスワードを入力するユーザが存在しない場合にこのオプションは有用かもしれません。
</p></dd><dt><span class="term"><code class="option">-W</code><br /></span><span class="term"><code class="option">--password</code></span></dt><dd><p>
<span class="original">
Force <application>pg_receivewal</application> to prompt for a
password before connecting to a database.
</span>
<span class="application">pg_receivewal</span>はデータベースに接続する前にパスワード入力を強制的に促します。
</p><p>
<span class="original">
This option is never essential, since
<application>pg_receivewal</application> will automatically prompt
for a password if the server demands password authentication.
However, <application>pg_receivewal</application> will waste a
connection attempt finding out that the server wants a password.
In some cases it is worth typing <option>-W</option> to avoid the extra
connection attempt.
</span>
このオプションは重要ではありません。
<span class="application">pg_receivewal</span>は、サーバがパスワード認証を要求した場合に自動的にパスワードを促すためです。
しかし<span class="application">pg_receivewal</span>は、サーバがパスワードを要求するかどうかを確認するために接続試行を浪費します。
<code class="option">-W</code>と入力して無駄な接続試行を防止することが有意である場合があります。
</p></dd></dl></div><p>
</p><p>
<span class="original">
<application>pg_receivewal</application> can perform one of the two
following actions in order to control physical replication slots:
</span>
<span class="application">pg_receivewal</span>は物理レプリケーションスロットを制御するため、以下の2つの動作のうちの1つを実行できます。
</p><div class="variablelist"><dl class="variablelist"><dt><span class="term"><code class="option">--create-slot</code></span></dt><dd><p>
<span class="original">
Create a new physical replication slot with the name specified in
<option>&#45;-slot</option>, then exit.
</span>
<code class="option">--slot</code>で指定された名前の新しい物理レプリケーションスロットを作成して終了します。
</p></dd><dt><span class="term"><code class="option">--drop-slot</code></span></dt><dd><p>
<span class="original">
Drop the replication slot with the name specified in
<option>&#45;-slot</option>, then exit.
</span>
<code class="option">--slot</code>で指定された名前のレプリケーションスロットを削除して終了します。
</p></dd></dl></div><p>
</p><p>
<span class="original">
Other options are also available:
</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>pg_receivewal</application> version and exit.
</span>
<span class="application">pg_receivewal</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_receivewal</application> command line
arguments, and exit.
</span>
<span class="application">pg_receivewal</span>コマンドライン引数についてのヘルプを表示し、終了します。
</p></dd></dl></div><p>
</p></div><div class="refsect1" id="id-1.9.4.17.7"><h2>終了ステータス</h2><span class="original">
<title>Exit Status</title>
</span><p>
<span class="original">
<application>pg_receivewal</application> will exit with status 0 when
terminated by the <systemitem>SIGINT</systemitem> or
<systemitem>SIGTERM</systemitem> signal. (That is the
normal way to end it. Hence it is not an error.) For fatal errors or
other signals, the exit status will be nonzero.
</span>
<span class="application">pg_receivewal</span>は<span class="systemitem">SIGINT</span>または<span class="systemitem">SIGTERM</span>シグナルで終了されたとき、ステータス0で終了します。
(これは止めるための通常の方法です。
そのためエラーではありません。)
致命的エラーや他のシグナルに対しては、終了ステータスは非ゼロになります。
</p></div><div class="refsect1" id="id-1.9.4.17.8"><h2>環境</h2><span class="original">
<title>Environment</title>
</span><p>
<span class="original">
This utility, like most other <productname>PostgreSQL</productname> utilities,
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="32.15. 環境変数">32.15</a>参照)を使います。
</p><p>
<span class="original">
The environment variable <envar>PG_COLOR</envar> specifies whether to use
color in diagnostic messages. Possible values are
<literal>always</literal>, <literal>auto</literal> and
<literal>never</literal>.
</span>
環境変数<code class="envar">PG_COLOR</code>は診断メッセージで色を使うかどうかを指定します。
指定可能な値は<code class="literal">always</code>、<code class="literal">auto</code>、<code class="literal">never</code>です。
</p></div><div class="refsect1" id="id-1.9.4.17.9"><h2>注釈</h2><span class="original">
<title>Notes</title>
</span><p>
<span class="original">
When using <application>pg_receivewal</application> instead of
<xref linkend="guc-archive-command"/> or
<xref linkend="guc-archive-library"/> as the main WAL backup method, it is
strongly recommended to use replication slots. Otherwise, the server is
free to recycle or remove write-ahead log files before they are backed up,
because it does not have any information, either
from <xref linkend="guc-archive-command"/> or
<xref linkend="guc-archive-library"/> or the replication slots, about
how far the WAL stream has been archived. Note, however, that a
replication slot will fill up the server's disk space if the receiver does
not keep up with fetching the WAL data.
</span>
WALのバックアップのメインの方法として、<a class="xref" href="runtime-config-wal.html#GUC-ARCHIVE-COMMAND">archive_command</a>や<a class="xref" href="runtime-config-wal.html#GUC-ARCHIVE-LIBRARY">archive_library</a>の代わりに<span class="application">pg_receivewal</span>を使用する場合、レプリケーションスロットを使用することを強く推奨します。
そうしなければ、サーバは<a class="xref" href="runtime-config-wal.html#GUC-ARCHIVE-COMMAND">archive_command</a>や<a class="xref" href="runtime-config-wal.html#GUC-ARCHIVE-LIBRARY">archive_library</a>、レプリケーションスロットのいずれからもWALのストリームがどこまでアーカイブされているかの情報を得られないため、先行書き込みログ(WAL)ファイルがバックアップされる前にそれを再利用または削除するかもしれないのです。
しかし、WALデータを受け取る側がそのフェッチに追いつけない場合、レプリケーションスロットがサーバのディスクスペースを一杯にしてしまうかもしれないことに注意してください。
</p><p>
<span class="original">
<application>pg_receivewal</application> will preserve group permissions on
the received WAL files if group permissions are enabled on the source
cluster.
</span>
<span class="application">pg_receivewal</span>は、ソースクラスタでグループパーミッションが有効である場合、受け取ったWALファイルのグループパーミッションを維持します。
</p></div><div class="refsect1" id="id-1.9.4.17.10"><h2>例</h2><span class="original">
<title>Examples</title>
</span><p>
<span class="original">
To stream the write-ahead log from the server at
<literal>mydbserver</literal> and store it in the local directory
<filename>/usr/local/pgsql/archive</filename>:
</span>
先行書き込みログ(WAL)を<code class="literal">mydbserver</code>にあるサーバからストリームし、それをローカルディレクトリ<code class="filename">/usr/local/pgsql/archive</code>に格納します。
</p><pre class="screen">
<code class="prompt">$</code> <strong class="userinput"><code>pg_receivewal -h mydbserver -D /usr/local/pgsql/archive</code></strong>
</pre></div><div class="refsect1" id="id-1.9.4.17.11"><h2>関連項目</h2><span class="original">
<title>See Also</title>
</span><span class="simplelist"><a class="xref" href="app-pgbasebackup.html" title="pg_basebackup"><span class="refentrytitle"><span class="application">pg_basebackup</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-pg-isready.html" title="pg_isready">前へ</a> </td><td width="20%" align="center"><a accesskey="u" href="reference-client.html" title="PostgreSQLクライアントアプリケーション">上へ</a></td><td width="40%" align="right"> <a accesskey="n" href="app-pgrecvlogical.html" title="pg_recvlogical">次へ</a></td></tr><tr><td width="40%" align="left" valign="top"><span class="application">pg_isready</span> </td><td width="20%" align="center"><a accesskey="h" href="index.html" title="PostgreSQL 18.3文書">ホーム</a></td><td width="40%" align="right" valign="top"> <span class="application">pg_recvlogical</span></td></tr></table></div></body></html>