public inbox for [email protected]  
help / color / mirror / Atom feed
From: Yugo NAGATA <[email protected]>
To: [email protected]
Subject: Question about non-blocking mode in libpq
Date: Tue, 13 Jul 2021 11:59:49 +0900
Message-ID: <[email protected]> (raw)

Hello,

During reading the documentation of libpq [1] , I found the following
description:

 In the nonblocking state, calls to PQsendQuery, PQputline, PQputnbytes,
 PQputCopyData, and PQendcopy will not block but instead return an error
 if they need to be called again.

[1] https://www.postgresql.org/docs/devel/libpq-async.html

However, looking into the code, PQsendQuery seems not to return an error
in non-bloking mode even if unable to send all data. In such cases,
pqSendSome will return 1 but it doesn't cause an error. Moreover,
we would not need to call PQsendQuery again. Indead, we need to call
PQflush until it returns 0, as documented with regard to PQflush.

Do we need to fix the description of PQsetnonblocking?

Regards,
Yugo Nagata

-- 
Yugo NAGATA <[email protected]>





view thread (4+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected]
  Subject: Re: Question about non-blocking mode in libpq
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox