I'm having problem with libpq's PQexec
function hanging on intermittent
connections. After looking around the mailing list, the solution is to use the
asynchronous functions PQsendQuery
/PQgetResult
and implement your own timeout.
Now the
issue I'm facing is that PQgetResult
needs to be called multiple times until
it returns null
and then you know it's done. However, the rest of my
application expects a single PQresult
object per query.
So my question is:
- Is there a way to concatenate/join the multiple
PQresult
s? - Can I somehow use
PQisBusy
&PQconsumeInput
to wait until all the results are ready before callingPQgetResult
?