Waits for the next result from a prior
PQsendQuery,PQsendQueryParams,PQsendPrepare,PQsendQueryPrepared,PQsendDescribePrepared,PQsendDescribePortal, orPQpipelineSynccall, and returns it. A null pointer is returned when the command is complete and there will be no more results.
PQgetResultmust be called repeatedly until it returns a null pointer, indicating that the command is done. (If called when no command is active,PQgetResultwill just return a null pointer at once.) Each non-null result fromPQgetResultshould be processed using the samePGresultaccessor functions prebiously described. Don't forget to free each result object withPQclearwhen done with it. Note thatPQgetResultwill block only if a command is active and the necessary response data has not yet been read byPQconsumeInput.In pipeline mode,
PQgetResultwill 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_ABORTEDwill be returned, and a null pointer will be returned after it. When the pipeline synchronization point is reached, a result of typePGRES_PIPELINE_SYNCwill 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 |