can't get async mode to deliver small batches of rows
| От | Mark Harrison |
|---|---|
| Тема | can't get async mode to deliver small batches of rows |
| Дата | |
| Msg-id | 40AD3CA8.8030707@pixar.com обсуждение исходный текст |
| Ответы |
Re: can't get async mode to deliver small batches of rows
|
| Список | 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
В списке pgsql-general по дате отправления: