From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: jbe-mlist@magnetkern.de
To: pgsql-docs@lists.postgresql.org
Subject: Re: Non-blocking synchronization in libpq using pipeline mode
Date: Tue, 19 Mar 2024 12:49:23 +0100
Message-ID: <202403191149.asubmjesltim@alvherre.pgsql> (raw)
In-Reply-To: <170976853548.643.17571475764668611072@wrigleys.postgresql.org>
On 2024-Mar-06, PG Doc comments form wrote:
> The following documentation comment has been logged on the website:
>
> Page: https://www.postgresql.org/docs/16/libpq-pipeline-mode.html
> Description:
>
> The calls to PQpipelineSync and PQsendFlushRequest may either report failure
> or success, but not that data could not be written as of yet because the
> request would block.
Is this a literal quote? If so, where do you see it?
> Does this mean that
>
> 1. these functions will always block when invoked and the socket is not
> ready to accept the number of bytes that need to be written (assuming the
> number of bytes required to be written is greater than one byte)
No.
> 2. the synchronization or flush request need to be flushed manually with
> successive PQflush calls
Yes.
> or
>
> 3. the functions will return an error condition when the connection is
> non-blocking and no data could be written.
No.
> Any clarification in the documentation would be appreciated.
So I checked https://www.postgresql.org/docs/16/libpq-pipeline-mode.html
and it has this, under PQsendFlushRequest:
The server flushes its output buffer automatically as a result of
PQpipelineSync being called, or on any request when not in pipeline
mode; this function is useful to cause the server to flush its output
buffer in pipeline mode without establishing a synchronization point.
Note that the request is not itself flushed to the server
automatically; use PQflush if necessary.
which I think answers what you are asking.
--
Álvaro Herrera Breisgau, Deutschland — https://www.EnterpriseDB.com/
"Just treat us the way you want to be treated + some extra allowance
for ignorance." (Michael Brusser)
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: pgsql-docs@postgresql.org
Cc: alvherre@alvh.no-ip.org, jbe-mlist@magnetkern.de, pgsql-docs@lists.postgresql.org
Subject: Re: Non-blocking synchronization in libpq using pipeline mode
In-Reply-To: <202403191149.asubmjesltim@alvherre.pgsql>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox