Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitcb3b3ed

Browse files
committed
In PQnotifies discussion, reference PQsocket as function needed to get
file descriptor number for select(). (Suggestion from Ken Wright.)
1 parentd2684ea commitcb3b3ed

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

‎doc/src/sgml/libpq.sgml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1460,13 +1460,17 @@ deprecated as a waste of processing power.
14601460
<para>
14611461
A better way to check for NOTIFY
14621462
messages when you have no useful queries to make is to call
1463-
<function>PQconsumeInput()</function>, then check <function>PQnotifies()</function>.
1463+
<function>PQconsumeInput()</function>, then check
1464+
<function>PQnotifies()</function>.
14641465
You can use <function>select</function>(2) to wait for backend data to
14651466
arrive, thereby using no <acronym>CPU</acronym> power unless there is something
1466-
to do. Note that this will work OK whether you use <function>PQsendQuery</function>/
1467-
<function>PQgetResult</function> or simply <function>PQexec</function> for
1468-
queries. You should, however, remember to check <function>PQnotifies()</function>
1469-
after each <function>PQgetResult</function> or <function>PQexec</function> to see
1467+
to do. (See <function>PQsocket()</function> to obtain the file descriptor
1468+
number to use with <function>select</function>.)
1469+
Note that this will work OK whether you submit queries with
1470+
<function>PQsendQuery</function>/<function>PQgetResult</function> or simply
1471+
use <function>PQexec</function>. You should, however, remember to
1472+
check <function>PQnotifies()</function> after each
1473+
<function>PQgetResult</function> or <function>PQexec</function>, to see
14701474
if any notifications came in during the processing of the query.
14711475
</para>
14721476

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp