ntinos@aueb.gr writes:
> if (PQconsumeInput(conn)!=1) elog(ERROR,"Error in consume...");
> else
> {
> elog(INFO,"OK with PQconsumeInput");
> //Will use a cursor and 'while' later when this
> //will have been fixed...
> if (!PQisBusy(conn))
> {
> res=PQgetResult(conn);
> }
> else elog(INFO,"It is too busy to give me the results!");
> }
PQconsumeInput has to be part of the loop. PQisBusy doesn't change any
state, it just tells you whether PQconsumeInput has collected a complete
query result yet.
regards, tom lane