Follow up: Where it says...
PGresult *res = PQexec("select * from foo");
for (int i = 0; i < PQntuples(res); i++) { printf("%s\n", PQgetValue(res, i, 0); PQflush(res) // NEW NEW
}
It should say...
PGresult *res = PQexec("select * from foo");
for (int i = 0; i < PQntuples(res); i++) { printf("%s\n", PQgetValue(res, i, 0); PQflush(res, -1) // NEW NEW
}
The -1 argument signifying "flush everything". A specific number
signifying "flush everything below this threshold", where the threshold
is a tuple number.