php.net |  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
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
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
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.



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2021-09-09 17:09 UTC] cmb@php.net
-Status: Open +Status: Verified
 [2021-09-09 17:09 UTC] cmb@php.net
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>
 [2021-09-09 17:09 UTC] cmb@php.net
-Package: Documentation problem +Package: PostgreSQL related
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 14:01:29 2024 UTC