Doc #79253 [Opn->Ver]: doc for pg_get_result() fails to mention its implementation is syncronous

[email protected]
Newsgroups php.doc.bugs
Message-ID <[email protected]>
Edit report at https://bugs.php.net/bug.php?id=79253&edit=1

 ID:                 79253
 Updated by:         [email protected]
 Reported by:        mikko dot rantalainen at peda dot net
 Summary:            doc for pg_get_result() fails to mention its
                     implementation is syncronous
-Status:             Open
+Status:             Verified
 Type:               Documentation Problem
 Package:            Documentation problem
 Operating System:   Ubuntu Linux 16.04 LTS
 PHP Version:        7.4.2
 Block user comment: N
 Private report:     N

 New Comment:

pg_get_result() is a wrapper for PQgetResult(3), and its
documentation clarifies that.

[1] <https://www.postgresql.org/docs/current/libpq-async.html#LIBPQ-PQGETRESULT>


Previous Comments:
------------------------------------------------------------------------
[2020-02-10 14:01:29] mikko dot rantalainen at peda dot net

Description:
------------
---
From manual page: https://php.net/function.pg-get-result
---

The documentation makes reader to believe that this function is asyncronous. For example:

"pg_get_result — Get asynchronous query result"
"pg_get_result() gets the result resource from an asynchronous query executed by ..."

However, in reality the behavior of pg_get_result() appears to be that it will
wait for the query to complete before returning if the query has not yet been
fully processed. As such, the function pg_get_result() is syncronous but it is
used to get results from an asyncronous function.

In addition, the description is unclear about if the expected style is to always repeatedly call pg_get_result() until FALSE is returned. Another way to use this
method is call this exactly once for each pg_send_query() that is supposed to contain one query.




------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=79253&edit=1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.