473,326 Members | 2,175 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

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

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 ma*******@postgresql.org so that your
message can get through to the mailing list cleanly

Nov 23 '05 #1
1 1474
Mark Harrison <mh@pixar.com> writes:
I can't seem to get PG into non-blocking mode.


"Non-blocking" does not mean "will deliver an incomplete result".
It just means you can get control back while waiting for the complete
result (though not with the code you show...)

You probably want to think about creating a cursor and FETCHing
a few rows per query.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Nov 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Burt Lewis | last post by:
Hi, I have 2 xsl style sheets calling separate rss feeds and I use ASP to display. Problem is that the 1st xsl takes on the style of the 2nd xsl even though they are different formats. I...
6
by: eXseraph | last post by:
Hi, As we know,in normal asp.net application, a browser need to send a request to a server first to refresh its page. Now I need to design a asp.net application with real-time capability like the...
4
by: Daylor | last post by:
hi. i have multi thread application in vb.net is there a way NET support, so i can mark the class , to be access only for 1 thread each time ? if there is , small sytax sample will help ...
3
by: shorti | last post by:
I know this subject has come up many times but I am not finding what I am looking for after a couple days of searching. I know some months ago I saw an indirect solution for this but I cant seem...
52
by: MP | last post by:
Hi trying to begin to learn database using vb6, ado/adox, mdb format, sql (not using access...just mdb format via ado) i need to group the values of multiple fields - get their possible...
1
by: rockdale | last post by:
Hi, all Did not find a .Net Communication forum to post. I am soing a client/server message system and using C#.net socket and Async mode. Pretty much as described in article ...
1
by: =?Utf-8?B?TWFyaw==?= | last post by:
Hi... There are a few questions wrapped up in this, but the main one is that the WebService.MyMethodAsync() methods that are automatically generated in the client code by VS 2005 don't seem to...
2
by: =?Utf-8?B?SGFycnkgS2Vjaw==?= | last post by:
I have introduced a component to my solution that is throwing an exception about needing to be run in single threaded apartment mode. This component is created in an async call by a...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.