|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #79253 doc for pg_get_result() fails to mention its implementation is syncronous
Submitted: 2020-02-10 14:01 UTC Modified: 2021-09-09 17:09 UTC
From: mikko dot rantalainen at peda dot net Assigned:
Status: Verified Package: PostgreSQL related
PHP Version: 7.4.2 OS: Ubuntu Linux 16.04 LTS
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: mikko dot rantalainen at peda dot net
New email:
PHP Version: OS:


 [2020-02-10 14:01 UTC] mikko dot rantalainen at peda dot net
From manual page:

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.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2021-09-09 17:09 UTC]
-Status: Open +Status: Verified
 [2021-09-09 17:09 UTC]
pg_get_result() is a wrapper for PQgetResult(3), and its
documentation clarifies that.

[1] <>
 [2021-09-09 17:09 UTC]
-Package: Documentation problem +Package: PostgreSQL related
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat May 25 17:01:30 2024 UTC