Re: libpq sendQuery -- getResult not returning until all queries complete

From: Kelly Burkhart <kelly(dot)burkhart(at)gmail(dot)com>
To: Peter Geoghegan <peter(dot)geoghegan86(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: libpq sendQuery -- getResult not returning until all queries complete
Date: 2010-12-21 19:28:23
Message-ID: AANLkTi=5SJMF_aiV3W-x8mD-HdbZmPPVUPhp7T-0uJiu@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Yes, I omitted the PQclear for simplicity.

I'm not concurrently executing queries, I'm sending multiple queries
to be executed serially by the backend. I'm expecting the server to
send me the PQresult objects as each query completes rather than
sending them all *after* all of the queries have completed.

That will result in some amount of concurrency as my client will be
processing one result while the backend is processing the next query.

-K

On Tue, Dec 21, 2010 at 1:21 PM, Peter Geoghegan
<peter(dot)geoghegan86(at)gmail(dot)com> wrote:
> You can't concurrently execute queries from within a single
> connection. Perhaps you should use multiple connections, while
> understanding the implications of having each operate within a
> separate snapshot.
>
> Don't forget to free memory with PQclear() . I guess you omitted that
> because it's just pseudo-code.
>
> --
> Regards,
> Peter Geoghegan
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Kelly Burkhart 2010-12-21 19:53:10 Re: libpq sendQuery -- getResult not returning until all queries complete
Previous Message Merlin Moncure 2010-12-21 19:26:56 Re: libpq sendQuery -- getResult not returning until all queries complete