can't get async mode to deliver small batches of rows

From: Mark Harrison <mh(at)pixar(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: can't get async mode to deliver small batches of rows
Date: 2004-05-20 23:18:00
Message-ID: 40AD3CA8.8030707@pixar.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I can't seem to get PG into non-blocking mode. Here is the result
I'm getting from the code attached below. I'm expecting to get
multiple "PQntuples=" lines, but instead I'm getting just one
with all 14M records. I've tried putting this into a cursor
as well, but still no joy...

any clues for the clueless?

Thanks!
Mark

PQstatus=0 CONNECTION_OK=0
rc,PQsetnonblocking=0
PQisnonblocking=1
rc,PQsendQuery=1
PQresultStatus=2 PGRES_TUPLES_OK=2
PQntuples=14345041

conn = PQconnectdb("dbname = mh");
printf("PQstatus=%d CONNECTION_OK=%d\n", PQstatus(conn), CONNECTION_OK);

rc = PQsetnonblocking(conn, 1);
printf("rc,PQsetnonblocking=%d\n", rc);
printf("PQisnonblocking=%d\n", PQisnonblocking(conn));

rc =PQsendQuery(conn, "select * from big");
printf("rc,PQsendQuery=%d\n", rc);

while ((res = PQgetResult(conn)) != NULL) {

printf("PQresultStatus=%d PGRES_TUPLES_OK=%d\n", PQresultStatus(res), PGRES_TUPLES_OK);
printf("PQntuples=%d\n", PQntuples(res));
PQclear(res);
}

PQfinish(conn);

--
Mark Harrison
Pixar Animation Studios

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Nick Allan 2004-05-21 01:30:32 Problem with public schema
Previous Message NTPT 2004-05-20 22:31:52 Unix timestamp , unix timestamp with microseconds ?