From: Andres Freund <andres@anarazel.de>
To: Pavel Stehule <pavel.stehule@gmail.com>
Cc: Konstantin Izmailov <pgfizm@gmail.com>
Cc: pgsql-general@postgresql.org <pgsql-general@postgresql.org>
Subject: Re: assembling PGresults from multiple simultaneous queries (libpq, singlerowmode)
Date: Sun, 7 Apr 2019 12:21:33 -0700
Message-ID: <20190407192133.5nmrwme2ritudilj@alap3.anarazel.de> (raw)
In-Reply-To: <CAFj8pRATA2yYv7rN3E86rJ9h7QLhskTbOmNi-f6qQ47wMvzieg@mail.gmail.com>
References: <CAAw-Msc4EOv-MKHBBmeVKnCQMnHLHzBXD1Z1a0enAurUKg0FrQ@mail.gmail.com>
<CAFj8pRATA2yYv7rN3E86rJ9h7QLhskTbOmNi-f6qQ47wMvzieg@mail.gmail.com>
Hi,
On 2019-04-07 20:57:56 +0200, Pavel Stehule wrote:
> ne 7. 4. 2019 v 20:47 odesÃlatel Konstantin Izmailov <pgfizm@gmail.com>
> napsal:
>
> > Hi,
> > I'm experimenting with Postgres 10 and protocol v3. I noticed that the
> > Postgres allows executing multiple queries simultaneously (I basically
> > commented out a check that prevents sending another query in libpq while
> > previous result(s) reading is not complete). Things appear like working,
> > but I just wanted to ask if anyone else tried the same (logically separate
> > results from multiple simultaneous queries)?
> >
> >
> Postgres cannot to execute simultaneous queries in one session. So queries
> should be executed in serial form every time.
I think what Konstantin is really talking about is pipelining
(i.e. sending multiple queries without waiting for the results
inbetween, thereby reducing latency), and that is actually supported by
postgres. Some drivers make fairly extensive use of it (e.g. the pgjdbc
driver).
As for libpq: No, that's currently not supported. There is a patch that
I hope to get into v13 however: https://commitfest.postgresql.org/20/1317
Greetings,
Andres Freund
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: andres@anarazel.de, pavel.stehule@gmail.com, pgfizm@gmail.com
Subject: Re: assembling PGresults from multiple simultaneous queries (libpq, singlerowmode)
In-Reply-To: <20190407192133.5nmrwme2ritudilj@alap3.anarazel.de>
References: <CAAw-Msc4EOv-MKHBBmeVKnCQMnHLHzBXD1Z1a0enAurUKg0FrQ@mail.gmail.com> <CAFj8pRATA2yYv7rN3E86rJ9h7QLhskTbOmNi-f6qQ47wMvzieg@mail.gmail.com> <20190407192133.5nmrwme2ritudilj@alap3.anarazel.de>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox