diff options
| author | Tom Lane | 2000-03-26 01:00:17 +0000 |
|---|---|---|
| committer | Tom Lane | 2000-03-26 01:00:17 +0000 |
| commit | cb3b3eda9a2a35a9ed2ad2eb97cd0355226499de (patch) | |
| tree | cc7d85856276f65f097acf9257d4c8900806520f | |
| parent | d2684ea712773104ab417ba76c3b821c6349639a (diff) | |
In PQnotifies discussion, reference PQsocket as function needed to get
file descriptor number for select(). (Suggestion from Ken Wright.)
| -rw-r--r-- | doc/src/sgml/libpq.sgml | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/doc/src/sgml/libpq.sgml b/doc/src/sgml/libpq.sgml index b700ce44975..c8cc2ee3e66 100644 --- a/doc/src/sgml/libpq.sgml +++ b/doc/src/sgml/libpq.sgml @@ -1460,13 +1460,17 @@ deprecated as a waste of processing power. <para> A better way to check for NOTIFY messages when you have no useful queries to make is to call -<function>PQconsumeInput()</function>, then check <function>PQnotifies()</function>. +<function>PQconsumeInput()</function>, then check +<function>PQnotifies()</function>. You can use <function>select</function>(2) to wait for backend data to arrive, thereby using no <acronym>CPU</acronym> power unless there is something -to do. Note that this will work OK whether you use <function>PQsendQuery</function>/ -<function>PQgetResult</function> or simply <function>PQexec</function> for -queries. You should, however, remember to check <function>PQnotifies()</function> -after each <function>PQgetResult</function> or <function>PQexec</function> to see +to do. (See <function>PQsocket()</function> to obtain the file descriptor +number to use with <function>select</function>.) +Note that this will work OK whether you submit queries with +<function>PQsendQuery</function>/<function>PQgetResult</function> or simply +use <function>PQexec</function>. You should, however, remember to +check <function>PQnotifies()</function> after each +<function>PQgetResult</function> or <function>PQexec</function>, to see if any notifications came in during the processing of the query. </para> |
