PG Bug reporting form <noreply@postgresql.org> writes:
> When processing asynchronous commands, I call the `PQconsumeInput` and
> `PQisBusy` functions to check if data has arrived, as shown below, but this
> does not work correctly in edge trigger mode for epoll and kqueue.
You have not really provided any evidence of a bug. The contract
for PQconsumeInput is that it will consume *some* input if any
is available, not that it will consume *all* available input.
(I don't think there is much reason to try to change that. In the
first place, there might not be enough buffer space, and in the
second place, even if it did consume all input, more might arrive
immediately after it looks.)
Without a self-contained test case, it's hard to be sure what is going
wrong for you; but my guess is that this is a bug in the way you are
checking for more available input rather than something libpq did
wrong.
> However, the `pqReadData()` function will not call the `pqsecure_read()`
> function until the `errno` is set to `EAGAIN` or `EWOULDBLOCK`,
Uh ... what?
regards, tom lane