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
---------------------------(end of broadcast)--------------------------- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to majordomo@postgresql.org so that your message can get through to the mailing list cleanly