Waits for the next result from a prior
PQsendQuery
,PQsendQueryParams
,PQsendPrepare
,PQsendQueryPrepared
,PQsendDescribePrepared
,PQsendDescribePortal
, orPQpipelineSync
call, and returns it. A null pointer is returned when the command is complete and there will be no more results.
PQgetResult
must be called repeatedly until it returns a null pointer, indicating that the command is done. (If called when no command is active,PQgetResult
will just return a null pointer at once.) Each non-null result fromPQgetResult
should be processed using the samePGresult
accessor functions prebiously described. Don't forget to free each result object withPQclear
when done with it. Note thatPQgetResult
will block only if a command is active and the necessary response data has not yet been read byPQconsumeInput
.In pipeline mode,
PQgetResult
will return normally unless an error occurs; for any subsequent query sent after the one that caused the error unit (and excluding) the next synchronization point, a special result of typePGRES_PIPELINE_ABORTED
will be returned, and a null pointer will be returned after it. When the pipeline synchronization point is reached, a result of typePGRES_PIPELINE_SYNC
will be returned. The result of the next query after the synchronization point follows immediately (that is, no null pointer is returned after the synchronization point).
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(c_ptr), | intent(in) | :: | conn |