Re: [HACKERS] Multiple queries in transit

2011-11-06 Thread Jeroen Vermeulen
On 2011-11-03 17:26, Marko Kreen wrote: On Mon, Oct 31, 2011 at 7:09 PM, Tom Lane wrote: Can't you do that today with a multi-command string submitted to PQsendQuery, followed by multiple calls to PQgetResult? It's more annoying to to error handling on that, plus it still keeps the blocking b

Re: [HACKERS] Multiple queries in transit

2011-11-03 Thread Marko Kreen
On Mon, Oct 31, 2011 at 7:09 PM, Tom Lane wrote: > Heikki Linnakangas writes: >> On 31.10.2011 17:44, Mark Hills wrote: >>> Could libpq be reasonably modified to allow this? > >> I believe it's doable in theory, no-one has just gotten around to it. >> Patches are welcome. > > Can't you do that to

Re: [HACKERS] Multiple queries in transit

2011-10-31 Thread Jeroen Vermeulen
On 2011-11-01 00:53, Merlin Moncure wrote: On Mon, Oct 31, 2011 at 12:49 PM, Mark Hills wrote: Furthermore, in most apps it'd be a serious PITA to keep track of which reply is for which query, so I doubt that such a feature is of general usefulness. In our UI case, we already have a queue.

Re: [HACKERS] Multiple queries in transit

2011-10-31 Thread Dimitri Fontaine
Heikki Linnakangas writes: > I think a common use for this would be doing multiple inserts or updates on > one go. Like, insert into a parent table, then more details into child > tables. You don't care about getting the results back in that case, as long > as you get an error on failure. As of 9

Re: [HACKERS] Multiple queries in transit

2011-10-31 Thread Merlin Moncure
On Mon, Oct 31, 2011 at 1:08 PM, Merlin Moncure wrote: > On Mon, Oct 31, 2011 at 12:49 PM, Merlin Moncure wrote: >> On Mon, Oct 31, 2011 at 12:09 PM, Tom Lane wrote: >>> Heikki Linnakangas writes: On 31.10.2011 17:44, Mark Hills wrote: > Could libpq be reasonably modified to allow this

Re: [HACKERS] Multiple queries in transit

2011-10-31 Thread Merlin Moncure
On Mon, Oct 31, 2011 at 12:49 PM, Merlin Moncure wrote: > On Mon, Oct 31, 2011 at 12:09 PM, Tom Lane wrote: >> Heikki Linnakangas writes: >>> On 31.10.2011 17:44, Mark Hills wrote: Could libpq be reasonably modified to allow this? >> >>> I believe it's doable in theory, no-one has just gott

Re: [HACKERS] Multiple queries in transit

2011-10-31 Thread Merlin Moncure
On Mon, Oct 31, 2011 at 12:49 PM, Mark Hills wrote: > On Mon, 31 Oct 2011, Tom Lane wrote: > >> Heikki Linnakangas writes: >> > On 31.10.2011 17:44, Mark Hills wrote: >> >> Could libpq be reasonably modified to allow this? >> >> > I believe it's doable in theory, no-one has just gotten around to

Re: [HACKERS] Multiple queries in transit

2011-10-31 Thread Mark Hills
On Mon, 31 Oct 2011, Tom Lane wrote: > Heikki Linnakangas writes: > > On 31.10.2011 17:44, Mark Hills wrote: > >> Could libpq be reasonably modified to allow this? > > > I believe it's doable in theory, no-one has just gotten around to it. > > Patches are welcome. > > Can't you do that today w

Re: [HACKERS] Multiple queries in transit

2011-10-31 Thread Merlin Moncure
On Mon, Oct 31, 2011 at 12:09 PM, Tom Lane wrote: > Heikki Linnakangas writes: >> On 31.10.2011 17:44, Mark Hills wrote: >>> Could libpq be reasonably modified to allow this? > >> I believe it's doable in theory, no-one has just gotten around to it. >> Patches are welcome. > > Can't you do that t

Re: [HACKERS] Multiple queries in transit

2011-10-31 Thread Heikki Linnakangas
On 31.10.2011 19:09, Tom Lane wrote: Heikki Linnakangas writes: On 31.10.2011 17:44, Mark Hills wrote: Could libpq be reasonably modified to allow this? I believe it's doable in theory, no-one has just gotten around to it. Patches are welcome. Can't you do that today with a multi-command

Re: [HACKERS] Multiple queries in transit

2011-10-31 Thread Tom Lane
Heikki Linnakangas writes: > On 31.10.2011 17:44, Mark Hills wrote: >> Could libpq be reasonably modified to allow this? > I believe it's doable in theory, no-one has just gotten around to it. > Patches are welcome. Can't you do that today with a multi-command string submitted to PQsendQuery, f

Re: [HACKERS] Multiple queries in transit

2011-10-31 Thread Marti Raudsepp
I have nothing of substance to add, but On Mon, Oct 31, 2011 at 17:44, Mark Hills wrote: > Instead, it would be preferable to send multiple requests (down the TCP > socket), and then receive multiple responses (in order). HTTP calls this "pipelining". I think it's helpful to adopt this term sinc

Re: [HACKERS] Multiple queries in transit

2011-10-31 Thread Heikki Linnakangas
On 31.10.2011 17:44, Mark Hills wrote: We have a user interface which fetches and displays many small pieces of distinct information from a PostgreSQL database. * fetches are simple lookups across a diverse set of tables, in response to events on another data source * uses PQsendQuery() on a

[HACKERS] Multiple queries in transit

2011-10-31 Thread Mark Hills
We have a user interface which fetches and displays many small pieces of distinct information from a PostgreSQL database. * fetches are simple lookups across a diverse set of tables, in response to events on another data source * uses PQsendQuery() on a non-blocking socket But data fetches vi