I am having trouble using libpq to query my database in a non-blocking
manner. My test program looks like this:
conn = PQsetdb(NULL, NULL, NULL, NULL, "test");
PQsendQuery(conn, "select * from test_tbl");
res = PQgetResult(conn);
printf("%s.\n", PQgetvalue(res, 0, 0));
First off, is this OK? (Of course, my real program does things whilst
PQisBusy() and checks for errors etc.)
My problem is that PQisBusy() is never returning FALSE because
conn->asyncStatus is always PGASYNC_BUSY.
PQisBusy() looks like this:
/* Parse any available data, if our state permits. */
/* PQgetResult will return immediately in all states except BUSY. */
return (conn->asyncStatus == PGASYNC_BUSY);
It seems to me that the call to parseInput() will never do anything
because there is no way that data will be read from the backend. Is
that correct? Is the user application supposed to do that?
I am using a snapshot dated a month or two ago.
Thanks in advance,
pgsql-interfaces by date
|Next:||From: Herouth Maoz||Date: 1998-07-15 09:40:36|
|Subject: Re: [INTERFACES] libpq & user|
|Previous:||From: Herouth Maoz||Date: 1998-07-15 08:33:59|
|Subject: RE: [INTERFACES] What technology ???|