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  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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 по дате отправления:

Предыдущее
От: Thomas Beutin
Дата:
Сообщение: Re: problem with sorting using 'ORDER BY' when character field is filled with numerical values
Следующее
От: Jeff Davis
Дата:
Сообщение: Am I locking more than I need to?