public inbox for [email protected]
help / color / mirror / Atom feedFrom: Michael Paquier <[email protected]>
To: Alvaro Herrera <[email protected]>
Cc: Jelte Fennema-Nio <[email protected]>
Cc: Anthonin Bonnefoy <[email protected]>
Cc: Anton Kirilov <[email protected]>
Cc: Robert Haas <[email protected]>
Cc: [email protected]
Subject: Re: Add PQsendSyncMessage() to libpq
Date: Tue, 16 Jan 2024 12:32:22 +0900
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
<[email protected]>
On Mon, Jan 15, 2024 at 10:49:56AM +0100, Alvaro Herrera wrote:
> the new function pqPipelineSyncInternal is not a wrapper for these other
> two functions -- the opposite is true actually. We tend to use the term
> "workhorse" or "internal workhorse" for this kind of thing.
Indeed, makes sense.
> In the docs, after this patch we have
>
> - PQpipelineSync
> - PQsendFlushRequest
> - PQsendPipelineSync
>
> Wouldn't it make more sense to add the new function in the middle of the
> two existing ones instead?
Ordering PQsendPipelineSync just after PQpipelineSync is OK by me.
I've applied the patch with all these modifications to move on with
the subject.
> Looking again at the largish comment that's now atop
> pqPipelineSyncInternal(), I think most of it should be removed -- these
> things should be explained in the SGML docs, and I think they are, in
> the "Using Pipeline Mode" section. We can just have the lines this
> patch is adding.
Hmm. The first two sentences about being able to submit more commands
to the pipeline are documented in the subsection "Issuing Queries".
The third sentence is implied in the second paragraph of this
subsection. The 4th paragraph of the comment where sync commands
cannot be issued until all the results from the pipeline have been
consumed is mentioned in the first paragraph in "Using Pipeline Mode".
So you are right that this could be entirely removed.
How about the attached to remove all that, then?
--
Michael
Attachments:
[text/x-diff] libpq-exec-comments.patch (1.3K, ../[email protected]/2-libpq-exec-comments.patch)
download | inline diff:
diff --git a/src/interfaces/libpq/fe-exec.c b/src/interfaces/libpq/fe-exec.c
index 52d41658c1..152b100624 100644
--- a/src/interfaces/libpq/fe-exec.c
+++ b/src/interfaces/libpq/fe-exec.c
@@ -3245,23 +3245,6 @@ PQsendPipelineSync(PGconn *conn)
/*
* Workhorse function for PQpipelineSync and PQsendPipelineSync.
*
- * It's legal to start submitting more commands in the pipeline immediately,
- * without waiting for the results of the current pipeline. There's no need to
- * end pipeline mode and start it again.
- *
- * If a command in a pipeline fails, every subsequent command up to and
- * including the result to the Sync message sent by pqPipelineSyncInternal
- * gets set to PGRES_PIPELINE_ABORTED state. If the whole pipeline is
- * processed without error, a PGresult with PGRES_PIPELINE_SYNC is produced.
- *
- * Queries can already have been sent before pqPipelineSyncInternal is called,
- * but pqPipelineSyncInternal needs to be called before retrieving command
- * results.
- *
- * The connection will remain in pipeline mode and unavailable for new
- * synchronous command execution functions until all results from the pipeline
- * are processed by the client.
- *
* immediate_flush controls if the flush happens immediately after sending the
* Sync message or not.
*/
[application/pgp-signature] signature.asc (833B, ../[email protected]/3-signature.asc)
download
view thread (15+ 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], [email protected], [email protected], [email protected], [email protected], [email protected]
Subject: Re: Add PQsendSyncMessage() to 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