-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbgworker.html
More file actions
238 lines (238 loc) · 29.9 KB
/
Copy pathbgworker.html
File metadata and controls
238 lines (238 loc) · 29.9 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
<?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>第45章 バックグラウンドワーカプロセス</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.78.1" /><link rel="home" href="index.html" title="PostgreSQL 9.5.4文書" /><link rel="up" href="server-programming.html" title="パート V. サーバプログラミング" /><link rel="prev" href="spi-examples.html" title="44.5. 例" /><link rel="next" href="logicaldecoding.html" title="第46章 ロジカルデコーディング" /><link rel="copyright" href="legalnotice.html" title="法的告知" /><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.5.4文書</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.5.4 bgworker.html">誤訳等の報告</a></div></td></tr><tr><td width="10%" align="left" valign="top"><a accesskey="p" href="spi-examples.html">前へ</a> </td><td width="10%" align="left" valign="top"><a accesskey="u" href="server-programming.html">上へ</a></td><td width="60%" align="center">第45章 バックグラウンドワーカプロセス</td><td width="20%" align="right" valign="top"> <a accesskey="n" href="logicaldecoding.html">次へ</a></td></tr></table><hr /></div><div class="chapter" id="bgworker"><div class="titlepage"><div><div><h2 class="title">第45章 バックグラウンドワーカプロセス</h2></div></div></div><span class="original">
<title>Background Worker Processes</title>
</span><a id="idp94708080" class="indexterm"></a><p><span class="original">
PostgreSQL can be extended to run user-supplied code in separate processes.
Such processes are started, stopped and monitored by <command>postgres</command>,
which permits them to have a lifetime closely linked to the server's status.
These processes have the option to attach to <productname>PostgreSQL</>'s
shared memory area and to connect to databases internally; they can also run
multiple transactions serially, just like a regular client-connected server
process. Also, by linking to <application>libpq</> they can connect to the
server and behave like a regular client application.
</span>PostgreSQLはユーザ提供のコードを別のプロセスとして実行できるように拡張することができます。
このプロセスは<code class="command">postgres</code>によって起動、終了、監視され、サーバの状態に密接にリンクしています。
これらのプロセスは<span class="productname">PostgreSQL</span>の共有メモリ領域にアタッチしたり、データベースの内部に接続するオプションを持ちます。これらはまた、通常のクライアントに接続された実際のサーバプロセスのように複数のトランザクションを連続して実行することができます。また、アプリケーションは<span class="application">libpq</span>とリンクすることにより通常のクライアントアプリケーションのようにサーバに接続して動作することができます。
</p><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">警告</h3><p><span class="original">
There are considerable robustness and security risks in using background
worker processes because, being written in the <literal>C</> language,
they have unrestricted access to data. Administrators wishing to enable
modules that include background worker process should exercise extreme
caution. Only carefully audited modules should be permitted to run
background worker processes.
</span>バックグラウンドワーカを使うにあたっては、堅牢性とセキュリティリスクを考慮しなくてはなりません。なぜならば、<code class="literal">C</code>言語で書かれており、データへのアクセスが制限されていないためです。バックグラウンドワーカプロセスを有効にしたいと思っている管理者は厳重に注意して実践すべきです。注意深く検査されたモジュールだけが、バックグラウンドワーカプロセスの実行を許されるべきです。
</p></div><p><span class="original">
Background workers can be initialized at the time that
<productname>PostgreSQL</> is started by including the module name in
<varname>shared_preload_libraries</>. A module wishing to run a background
worker can register it by calling
<function>RegisterBackgroundWorker(<type>BackgroundWorker *worker</type>)</function>
from its <function>_PG_init()</>. Background workers can also be started
after the system is up and running by calling the function
<function>RegisterDynamicBackgroundWorker(<type>BackgroundWorker
*worker, BackgroundWorkerHandle **handle</type>)</function>. Unlike
<function>RegisterBackgroundWorker</>, which can only be called from within
the postmaster, <function>RegisterDynamicBackgroundWorker</function> must be
called from a regular backend.
</span>バックグラウンドワーカは<span class="productname">PostgreSQL</span>スタート時にモジュールを <code class="varname">shared_preload_libraries</code> に記すことによって実行できます。バックグラウンドワーカとして実行したいモジュールは <code class="function">RegisterBackgroundWorker(<code class="type">BackgroundWorker *worker</code>)</code> を <code class="function">_PG_init()</code> から呼び出して登録する必要があります。バックグラウンドワーカはシステム起動後も <code class="function">RegisterDynamicBackgroundWorker(<code class="type">BackgroundWorker *worker, BackgroundWorkerHandle **handle</code>)</code> を呼び出すことによって実行することができます。<code class="function">RegisterBackgroundWorker</code> とは異なり、postmasterからのみ呼び出すことができます。 <code class="function">RegisterDynamicBackgroundWorker</code> は通常のバックエンドから呼び出す必要があります。
</p><p><span class="original">
The structure <structname>BackgroundWorker</structname> is defined thus:
</span>その構造、<code class="structname">BackgroundWorker</code> は以下のように定義されます。
</p><pre class="programlisting">typedef void (*bgworker_main_type)(Datum main_arg);
typedef struct BackgroundWorker
{
char bgw_name[BGW_MAXLEN];
int bgw_flags;
BgWorkerStartTime bgw_start_time;<span class="original">
int bgw_restart_time; /* in seconds, or BGW_NEVER_RESTART */
</span>
int bgw_restart_time; /* 秒単位、もしくは、BGW_NEVER_RESTART */
bgworker_main_type bgw_main;<span class="original">
char bgw_library_name[BGW_MAXLEN]; /* only if bgw_main is NULL */
char bgw_function_name[BGW_MAXLEN]; /* only if bgw_main is NULL */
</span>
char bgw_library_name[BGW_MAXLEN]; /* bgw_mainがNULLの場合のみ */
char bgw_function_name[BGW_MAXLEN]; /* bgw_mainがNULLの場合のみ */
Datum bgw_main_arg;
char bgw_extra[BGW_EXTRALEN];
int bgw_notify_pid;
} BackgroundWorker;</pre><p>
</p><p><span class="original">
<structfield>bgw_name</> is a string to be used in log messages, process
listings and similar contexts.
</span><code class="structfield">bgw_name</code> は、ログメッセージ、プロセス一覧等で使用される文字列です。
</p><p><span class="original">
<structfield>bgw_flags</> is a bitwise-or'd bit mask indicating the
capabilities that the module wants. Possible values are
<literal>BGWORKER_SHMEM_ACCESS</literal> (requesting shared memory access)
and <literal>BGWORKER_BACKEND_DATABASE_CONNECTION</literal> (requesting the
ability to establish a database connection, through which it can later run
transactions and queries). A background worker using
<literal>BGWORKER_BACKEND_DATABASE_CONNECTION</literal> to connect to
a database must also attach shared memory using
<literal>BGWORKER_SHMEM_ACCESS</literal>, or worker start-up will fail.
</span><code class="structfield">bgw_flags</code> は、モジュールが要求する機能をOR演算したビットマスクです。可能な値は <code class="literal">BGWORKER_SHMEM_ACCESS</code> (共有メモリへのアクセスを要求)と <code class="literal">BGWORKER_BACKEND_DATABASE_CONNECTION</code> (データベース接続を確立し、その後トランザクションやクエリの実行が可能です)。データベースに接続するために <code class="literal">BGWORKER_BACKEND_DATABASE_CONNECTION</code> を使っているバックグラウンドワーカもまた、 <code class="literal">BGWORKER_SHMEM_ACCESS</code> を使って共有メモリに接続しなければなりません、さもないとワーカの起動に失敗します。
</p><p><span class="original">
<structfield>bgw_start_time</structfield> is the server state during which
<command>postgres</> should start the process; it can be one of
<literal>BgWorkerStart_PostmasterStart</> (start as soon as
<command>postgres</> itself has finished its own initialization; processes
requesting this are not eligible for database connections),
<literal>BgWorkerStart_ConsistentState</> (start as soon as a consistent state
has been reached in a hot standby, allowing processes to connect to
databases and run read-only queries), and
<literal>BgWorkerStart_RecoveryFinished</> (start as soon as the system has
entered normal read-write state). Note the last two values are equivalent
in a server that's not a hot standby. Note that this setting only indicates
when the processes are to be started; they do not stop when a different state
is reached.
</span><code class="structfield">bgw_start_time</code> は、 <code class="command">postgres</code> がプロセスを起動するべきタイミングを指定します。そのタイミングは、 <code class="literal">BgWorkerStart_PostmasterStart</code> (<code class="command">postgres</code>自身が初期化を終えるとすぐに起動します。これを要求するプロセスはデータベース接続に望ましいものではありません。)、 <code class="literal">BgWorkerStart_ConsistentState</code> (ホットスタンバイで一貫性のある状態に到達すると、つまりデータベースに接続して参照のみのクエリを許可する状態になると起動します。)、 <code class="literal">BgWorkerStart_RecoveryFinished</code> (システムが参照/更新クエリを実行すると起動します。)のうちの一つです。この設定はいつプロセスが起動されるかを示すだけであることに注意してください。これらのプロセスは、違う状態になったときに停止するわけではありません。
</p><p><span class="original">
<structfield>bgw_restart_time</structfield> is the interval, in seconds, that
<command>postgres</command> should wait before restarting the process, in
case it crashes. It can be any positive value,
or <literal>BGW_NEVER_RESTART</literal>, indicating not to restart the
process in case of a crash.
</span><code class="structfield">bgw_restart_time</code> は、プロセスがクラッシュした場合に <code class="command">postgres</code> がそのプロセスを再起動するために待つべき間隔を秒単位で指定します。これは任意の正の値、またはクラッシュしても再起動しない場合は <code class="literal">BGW_NEVER_RESTART</code> を指定します。
</p><p><span class="original">
<structfield>bgw_main</structfield> is a pointer to the function to run when
the process is started. This function must take a single argument of type
<type>Datum</> and return <type>void</>.
<structfield>bgw_main_arg</structfield> will be passed to it as its only
argument. Note that the global variable <literal>MyBgworkerEntry</literal>
points to a copy of the <structname>BackgroundWorker</structname> structure
passed at registration time. <structfield>bgw_main</structfield> may be
NULL; in that case, <structfield>bgw_library_name</structfield> and
<structfield>bgw_function_name</structfield> will be used to determine
the entry point. This is useful for background workers launched after
postmaster startup, where the postmaster does not have the requisite
library loaded.
</span><code class="structfield">bgw_main</code> は、プロセスが起動されたときに実行される関数へのポインタです。この関数は<code class="type">Datum</code>型の引数を一つとり、 <code class="type">void</code> を返さなければなりません。
<code class="structfield">bgw_main_arg</code> は、唯一の引数として渡されます。グローバル変数である <code class="literal">MyBgworkerEntry</code> は、登録時に渡される <code class="structname">BackgroundWorker</code> 構造体のコピーを指すことに注意してください。<code class="structfield">bgw_main</code> は NULL であってもよく、その場合は <code class="structfield">bgw_library_name</code> と <code class="structfield">bgw_function_name</code> がエントリーポイントを決定するために使用されます。これはpostmater起動時にはpostmasterが必要なライブラリがロードされていないときにバックグラウンドワーカを後で立ち上げるときに有用です。
</p><p><span class="original">
<structfield>bgw_library_name</structfield> is the name of a library in
which the initial entry point for the background worker should be sought.
It is ignored unless <structfield>bgw_main</structfield> is NULL.
But if <structfield>bgw_main</structfield> is NULL, then the named library
will be dynamically loaded by the worker process and
<structfield>bgw_function_name</structfield> will be used to identify
the function to be called.
</span><code class="structfield">bgw_library_name</code> はバックグラウンドワーカの初期エントリーポイントのためのライブラリ名です。 <code class="structfield">bgw_main</code> がNULLでない限りそれは無視されます。 <code class="structfield">bgw_main</code> がNULLの場合、ワーカプロセスにより動的にロードされるライブラリ名です。 <code class="structfield">bgw_function_name</code> は呼び出される関数名を識別するために使用されます。
</p><p><span class="original">
<structfield>bgw_function_name</structfield> is the name of a function in
a dynamically loaded library which should be used as the initial entry point
for a new background worker. It is ignored unless
<structfield>bgw_main</structfield> is NULL.
</span><code class="structfield">bgw_function_name</code> は新しいバックグラウンドワーカから動的にロードされるときに初期エントリーポイントの関数名です。それは <code class="structfield">bgw_main</code> がNULLのとき無視されます。
</p><p><span class="original">
<structfield>bgw_extra</structfield> can contain extra data to be passed
to the background worker. Unlike <structfield>bgw_main_arg</>, this data
is not passed as an argument to the worker's main function, but it can be
accessed via <literal>MyBgworkerEntry</literal>, as discussed above.
</span><code class="structfield">bgw_extra</code>はバックグラウンドワーカに渡す追加データを含めることが出来ます。
<code class="structfield">bgw_main_arg</code>とは異なり、このデータはワーカのメイン関数の引数として渡されていませんが、上述したように<code class="literal">MyBgworkerEntry</code>を介してアクセスすることが出来ます。
</p><p><span class="original">
<structfield>bgw_notify_pid</structfield> is the PID of a PostgreSQL
backend process to which the postmaster should send <literal>SIGUSR1</>
when the process is started or exits. It should be 0 for workers registered
at postmaster startup time, or when the backend registering the worker does
not wish to wait for the worker to start up. Otherwise, it should be
initialized to <literal>MyProcPid</>.
</span><code class="structfield">bgw_notify_pid</code> はプロセスの開始時と終了時にpostmasterにSIGUSR1を送信するPostgreSQLバックエンドプロセスのPIDです。それはpostmasterの起動時間、またはワーカが起動するのを待ちたくない場合に0である必要があります。それ以外の場合は、 <code class="literal">MyProcPid</code> で初期化すべきです。
</p><span class="original">
<para>Once running, the process can connect to a database by calling
<function>BackgroundWorkerInitializeConnection(<parameter>char *dbname</parameter>, <parameter>char *username</parameter>)</function> or
<function>BackgroundWorkerInitializeConnectionByOid(<parameter>Oid dboid</parameter>, <parameter>Oid useroid</parameter>)</function>.
This allows the process to run transactions and queries using the
<literal>SPI</literal> interface. If <varname>dbname</> is NULL or
<varname>dboid</> is <literal>InvalidOid</>, the session is not connected
to any particular database, but shared catalogs can be accessed.
If <varname>username</> is NULL or <varname>useroid</> is
<literal>InvalidOid</>, the process will run as the superuser created
during <command>initdb</>.
A background worker can only call one of these two functions, and only
once. It is not possible to switch databases.
</para>
</span><p>ひとたび実行すると、このプロセスは<code class="function">BackgroundWorkerInitializeConnection(<em class="parameter"><code>char *dbname</code></em>, <em class="parameter"><code>char *username</code></em>)</code>または<code class="function">BackgroundWorkerInitializeConnectionByOid(<em class="parameter"><code>Oid dboid</code></em>, <em class="parameter"><code>Oid useroid</code></em>)</code>を呼び出すことによって、データベースに接続できます。
これはプロセスに<code class="literal">SPI</code>インタフェースを使用してのトランザクションとクエリの実行を許します。
もし、<code class="varname">dbname</code>がNULLであった場合、または<code class="varname">dboid</code>が<code class="literal">InvalidOid</code>であった場合には、そのセッションは特定のデータベースに接続しません。しかし、共有カタログにはアクセス出来ます。
もし、<code class="varname">username</code> がNULLの場合、または<code class="varname">useroid</code>が<code class="literal">InvalidOid</code>の場合には、そのプロセスは <code class="command">initdb</code>時に作成されたスーパーユーザとして実行されます。
バックグラウンドワーカはこれら2つの関数をどちらかを一度だけ呼ぶことが出来ます。
これはデータベースを切り替えることができません。
</p><p><span class="original">
Signals are initially blocked when control reaches the
<structfield>bgw_main</> function, and must be unblocked by it; this is to
allow the process to customize its signal handlers, if necessary.
Signals can be unblocked in the new process by calling
<function>BackgroundWorkerUnblockSignals</> and blocked by calling
<function>BackgroundWorkerBlockSignals</>.
</span> 制御が <code class="structfield">bgw_main</code> 関数に達したとき、シグナルはまずブロックされます。このブロックは解除されなければなりません。このことは、必要があれば、プロセスにそのシグナルハンドラをカスタマイズできることを意味します。シグナルは新しいプロセスで <code class="function">BackgroundWorkerUnblockSignals</code> を呼び出すことにより、解除でき、 <code class="function">BackgroundWorkerBlockSignals</code> を呼び出すことでブロックできます。
</p><p><span class="original">
If <structfield>bgw_restart_time</structfield> for a background worker is
configured as <literal>BGW_NEVER_RESTART</>, or if it exits with an exit
code of 0 or is terminated by <function>TerminateBackgroundWorker</>,
it will be automatically unregistered by the postmaster on exit.
Otherwise, it will be restarted after the time period configured via
<structfield>bgw_restart_time</>, or immediately if the postmaster
reinitializes the cluster due to a backend failure. Backends which need
to suspend execution only temporarily should use an interruptible sleep
rather than exiting; this can be achieved by calling
<function>WaitLatch()</function>. Make sure the
<literal>WL_POSTMASTER_DEATH</> flag is set when calling that function, and
verify the return code for a prompt exit in the emergency case that
<command>postgres</> itself has terminated.
</span> バックグラウンドワーカは <code class="structfield">bgw_restart_time</code> が <code class="literal">BGW_NEVER_RESTART</code> に設定されている場合、または <code class="function">TerminateBackgroundWorker</code> によって0で終了した場合、postmasterに自動的に登録が解除されて終了します。
それ以外の場合、 <code class="structfield">bgw_restart_time</code> で設定された時間の後に再起動します。または、バックエンドの障害のために posmasterが最初期化された場合はすぐに再起動します。
バックグラウンドワーカが何もすることがないときは、割り込み可能な休止状態にすることを考慮しないといけません。これは <code class="function">WaitLatch()</code> を呼び出すことによって可能になります。
この関数を呼んだときに、 <code class="literal">WL_POSTMASTER_DEATH</code> フラグが設定され、 <code class="command">postgres</code> 自身が終了する緊急事態には、リターンコードを確認するようにしてください。
</p><p><span class="original">
When a background worker is registered using the
<function>RegisterDynamicBackgroundWorker</function> function, it is
possible for the backend performing the registration to obtain information
regarding the status of the worker. Backends wishing to do this should
pass the address of a <type>BackgroundWorkerHandle *</type> as the second
argument to <function>RegisterDynamicBackgroundWorker</function>. If the
worker is successfully registered, this pointer will be initialized with an
opaque handle that can subsequently be passed to
<function>GetBackgroundWorkerPid(<parameter>BackgroundWorkerHandle *</parameter>, <parameter>pid_t *</parameter>)</function> or
<function>TerminateBackgroundWorker(<parameter>BackgroundWorkerHandle *</parameter>)</function>.
<function>GetBackgroundWorkerPid</> can be used to poll the status of the
worker: a return value of <literal>BGWH_NOT_YET_STARTED</> indicates that
the worker has not yet been started by the postmaster;
<literal>BGWH_STOPPED</literal> indicates that it has been started but is
no longer running; and <literal>BGWH_STARTED</literal> indicates that it is
currently running. In this last case, the PID will also be returned via the
second argument.
<function>TerminateBackgroundWorker</> causes the postmaster to send
<literal>SIGTERM</> to the worker if it is running, and to unregister it
as soon as it is not.
</span>バックグラウンドワーカを <code class="function">RegisterDynamicBackgroundWorker</code> 関数により登録している場合、登録を実行するバックエンドはワーカの状態に関する情報を取得することが可能です。取得したい場合は <code class="function">RegisterDynamicBackgroundWorker</code> に <code class="type">BackgroundWorkerHandle *</code> のアドレスを渡す必要があります。もし登録に成功した場合、 <code class="function">GetBackgroundWorkerPid(<em class="parameter"><code>BackgroundWorkerHandle *</code></em>, <em class="parameter"><code>pid_t *</code></em>)</code>または<code class="function">TerminateBackgroundWorker(<em class="parameter"><code>BackgroundWorkerHandle *</code></em>)</code> のポインタは初期化されます。
<code class="function">GetBackgroundWorkerPid</code> はワーカの状態を監視することができます。以下の返り値が得られます。 <code class="literal">BGWH_NOT_YET_STARTED</code> ワーカはまだpostmasterにより開始されていない。<code class="literal">BGWH_STOPPED</code>開始されたが、もはや実行されていない。 <code class="literal">BGWH_STARTED</code>実行中です。この最後のケースでは、PIDは、第二の引数を介して返されます。
<code class="function">TerminateBackgroundWorker</code>はワーカが実行していた場合postmasterがワーカに <code class="literal">SIGTERM</code> を送信し、まもなく登録を解除します。
</p><p><span class="original">
In some cases, a process which registers a background worker may wish to
wait for the worker to start up. This can be accomplished by initializing
<structfield>bgw_notify_pid</structfield> to <literal>MyProcPid</> and
then passing the <type>BackgroundWorkerHandle *</type> obtained at
registration time to
<function>WaitForBackgroundWorkerStartup(<parameter>BackgroundWorkerHandle
*handle</parameter>, <parameter>pid_t *</parameter>)</function> function.
This function will block until the postmaster has attempted to start the
background worker, or until the postmaster dies. If the background runner
is running, the return value will <literal>BGWH_STARTED</>, and
the PID will be written to the provided address. Otherwise, the return
value will be <literal>BGWH_STOPPED</literal> or
<literal>BGWH_POSTMASTER_DIED</literal>.
</span> 場合によっては、バックグラウンドワーカを登録する処理は、ワーカが起動するのを待つことをお勧めします。これは <code class="structfield">bgw_notify_pid</code> から <code class="literal">MyProcPid</code> で初期化し登録時に得られた <code class="type">BackgroundWorkerHandle *</code> を使用して <code class="function">WaitForBackgroundWorkerStartup(<em class="parameter"><code>BackgroundWorkerHandle *handle</code></em>, <em class="parameter"><code>pid_t *</code></em>)</code> 関数を呼び出すことで実現します。
postmasterがバックグラウンドワーカを開始しようと試みたか、postmasterが死ぬまで、この関数はブロックします。バックグラウンドランナーが実行されている場合、戻り値は <code class="literal">BGWH_STARTED</code> 、およびPIDが提供されたアドレスに書き込まれます。そうでない場合、戻り値は <code class="literal">BGWH_STOPPED</code> または <code class="literal">BGWH_POSTMASTER_DIED</code> になります。
</p><p><span class="original">
The <filename>src/test/modules/worker_spi</> module
contains a working example,
which demonstrates some useful techniques.
</span>バックグラウンドワーカの実例として、<code class="filename">src/test/modules/worker_spi</code>というモジュールがあります。
これはいくつかの有用な技術を示しています。
</p><p><span class="original">
The maximum number of registered background workers is limited by
<xref linkend="guc-max-worker-processes">.
</span>登録できるバックグラウンドワーカの数は <a class="xref" href="runtime-config-resource.html#guc-max-worker-processes">max_worker_processes</a>によって制限されています。
</p></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="spi-examples.html">前へ</a> </td><td width="20%" align="center"><a accesskey="u" href="server-programming.html">上へ</a></td><td width="40%" align="right"> <a accesskey="n" href="logicaldecoding.html">次へ</a></td></tr><tr><td width="40%" align="left" valign="top">44.5. 例 </td><td width="20%" align="center"><a accesskey="h" href="index.html">ホーム</a></td><td width="40%" align="right" valign="top"> 第46章 ロジカルデコーディング</td></tr></table></div></body></html>