Re: libpq pipelineing - Mailing list pgsql-general

From David G. Johnston
Subject Re: libpq pipelineing
Date
Msg-id CAKFQuwZtD7Ne6ANiOgCa40YhPBEhDcDMo8nK8TuR3LKUxbjnjA@mail.gmail.com
Whole thread Raw
In response to libpq pipelineing  (Samuel Williams <space.ship.traveller@gmail.com>)
Responses Re: libpq pipelineing  (Samuel Williams <space.ship.traveller@gmail.com>)
List pgsql-general
On Friday, June 26, 2020, Samuel Williams <space.ship.traveller@gmail.com> wrote:
Hello,

Using the asynchronous interface of libpq, is it possible to pipeline
multiple queries?

i.e.

PQsendQuery(query1)
PQsendQuery(query2)

followed by

query1_results = PQgetResult(...)
query2_results = PQgetResult(...)

I tried it but got "another command is already in progress" error.

The documentation seems to leave zero ambiguity:

 After successfully calling PQsendQuery, call PQgetResult one or more times to obtain the results. PQsendQuery cannot be called again (on the same connection) until PQgetResult has returned a null pointer, indicating that the command is done.

David J.

pgsql-general by date:

Previous
From: Samuel Williams
Date:
Subject: libpq pipelineing
Next
From: Samuel Williams
Date:
Subject: Re: libpq pipelineing