Hello,

On Thu, 4 May 2023, 11:36 Alvaro Herrera, <alvhe...@alvh.no-ip.org 
<mailto:alvhe...@alvh.no-ip.org>> wrote:
> On 2023-May-04, Anton Kirilov wrote:
> If you want to make sure it's fully flushed, your only option is to have
> the call block.


Surely PQflush() returning 0 would signify that the output buffer has been 
fully flushed? Which means that there is another, IMHO simpler option than 
introducing an extra flag - make the new function return the same values as 
PQflush(), i.e. 0 for no error and fully flushed output, -1 for error, and 1 
for partial flush (so that the user may start polling for write readiness). Of 
course, the function would never return 1 (but would block instead) unless the 
user has called PQsetnonblocking() beforehand.

Best wishes,
Anton Kirilov

Reply via email to