Re: [RFC] libpq extensions - followup - Mailing list pgsql-general

From Iker Arizmendi
Subject Re: [RFC] libpq extensions - followup
Date
Msg-id 20030126020019.02bf90fe.iker@research.att.com
Whole thread Raw
In response to Re: [RFC] libpq extensions - followup  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [RFC] libpq extensions - followup
List pgsql-general
Althought multiple queries can't be executed concurrently they can be
queued up by a connection object. For instance:

PGXquery* q1 = PQXcreateQuery(...);
PGXquery* q2 = PQXcreateQuery(...);
...
PGXquery* qN = PQXcreateQuery(...);

PQXexecute(conn1, q1);
PQXexecute(conn1, q2);
...
PQXexecute(conn1, qN);

while (1) { /* event loop code */ }

In this example, queries q1 through qN are "in flight" simultaneously as
far as the client is concerned even though the connection conn1 is
really queueing them up. During execution of the event loop, the
connection object manages the job of executing each query
sequentially (which, with respect to the client, is an implementation
detail).

Cheers,
Iker

On Sun, 26 Jan 2003 00:47:20 -0500
Tom Lane <tgl@sss.pgh.pa.us> wrote:

> Iker Arizmendi <iker@research.att.com> writes:
> > A while back I suggested that it would be useful if asynchronous
> > connections could support multiple queries "in flight", especially
> > if you're working on event driven applications (see topic "rfc -
> > libpq extensions"). I've since started work on a simple library,
>
> I must be missing something fundamental here.  The backend doesn't
> support multiple parallel queries, so how can you have "multiple
> queries in flight" on the same connection?
>
>             regards, tom lane


pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: [RFC] libpq extensions - followup
Next
From: "Alan T. Miller"
Date:
Subject: Can object oriented table design help to solve this problem?