Skip to content

Commit c789c00

Browse files
committed
Update bgworker.sgml
1 parent 8efe819 commit c789c00

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

postgresql/doc/src/sgml/bgworker.sgml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -220,14 +220,14 @@ ____________________________________________________________________________-->
220220
<!--==========================orignal english content==========================
221221
<para>
222222
<structfield>bgw_restart_time</structfield> is the interval, in seconds, that
223-
<command>postgres</command> should wait before restarting the process, in
224-
case it crashes. It can be any positive value,
223+
<command>postgres</command> should wait before restarting the process in
224+
the event that it crashes. It can be any positive value,
225225
or <literal>BGW_NEVER_RESTART</literal>, indicating not to restart the
226226
process in case of a crash.
227227
</para>
228228
____________________________________________________________________________-->
229229
<para>
230-
<structfield>bgw_restart_time</structfield>是在崩溃情况下<command>postgres</command>启动进程之前等待的时间间隔,以秒计。它可以是任何正值,或者<literal>BGW_NEVER_RESTART</literal>,表示在出现崩溃后不重启进程。
230+
<structfield>bgw_restart_time</structfield>是时间间隔,以秒计;是在进程崩溃情况下,<command>postgres</command>重新启动进程之前等待的时间间隔。它可以是任何正值,或者<literal>BGW_NEVER_RESTART</literal>,表示在出现崩溃后不重启进程。
231231
</para>
232232

233233
<!--==========================orignal english content==========================
@@ -466,19 +466,19 @@ ____________________________________________________________________________-->
466466

467467
<!--==========================orignal english content==========================
468468
<para>
469-
If a background worker sends asynchronous notifications with the
470-
<command>NOTIFY</command> command via the Server Programming Interface
471-
(<acronym>SPI</acronym>), it should call
472-
<function>ProcessCompletedNotifies</function> explicitly after committing
473-
the enclosing transaction so that any notifications can be delivered. If a
474-
background worker registers to receive asynchronous notifications with
475-
the <command>LISTEN</command> through <acronym>SPI</acronym>, the worker
476-
will log those notifications, but there is no programmatic way for the
477-
worker to intercept and respond to those notifications.
469+
Background workers can send asynchronous notification messages, either by
470+
using the <command>NOTIFY</command> command via <acronym>SPI</acronym>,
471+
or directly via <function>Async_Notify()</function>. Such notifications
472+
will be sent at transaction commit.
473+
Background workers should not register to receive asynchronous
474+
notifications with the <command>LISTEN</command> command, as there is no
475+
infrastructure for a worker to consume such notifications.
478476
</para>
479477
____________________________________________________________________________-->
480478
<para>
481-
如果一个后台工作者通过服务器编程接口(<acronym>SPI</acronym>)用<command>NOTIFY</command>命令发送异步通知,在提交外层事务之后它应该显式地调用<function>ProcessCompletedNotifies</function>,这样通知才能被发送出去。如果一个后台工作者通过<acronym>SPI</acronym>使用<command>LISTEN</command>注册为接收异步通知,它将记录那些通知,但是对于工作者来说没有程序化的方式可以拦截以及响应那些通知。
479+
后台工作者可以发送异步通知消息,可以通过<acronym>SPI</acronym>的<command>NOTIFY</command> 命令,或者直接通过 <function>Async_Notify()</function>。
480+
这样的通知将在事务提交的时候发送。
481+
后台工作者不应该使用<command>LISTEN</command>命令接收异步通知,因为工作者没有可以使用这些通知的基础架构。
482482
</para>
483483

484484
<!--==========================orignal english content==========================

0 commit comments

Comments
 (0)