]> git.ipfire.org Git - thirdparty/psycopg.git/commitdiff
docs: add note about implicit transactions and sync in pipeline mode
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>
Sat, 7 May 2022 15:29:25 +0000 (17:29 +0200)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Sat, 7 May 2022 15:29:25 +0000 (17:29 +0200)
docs/advanced/pipeline.rst

index d7613b12c474227e52f94dca653b3123fee26044..d13f95e0a01e12904e8c1a448c44c0c3f4b7bc5a 100644 (file)
@@ -28,11 +28,18 @@ immediately, not waiting for the end of the pipeline. Note that results are
 buffered on the server side; the server flushes that buffer when a
 :ref:`synchronization point <pipeline-sync>` is established.
 
-.. seealso:: The `PostgreSQL pipeline mode documentation`__ contains many
-    details around when it is most useful to use the pipeline mode and about
-    errors management and interaction with transactions.
+.. seealso::
+
+    The PostgreSQL documentation about:
+
+    - `pipeline mode`__
+    - `extended query message flow`__
+
+    contains many details around when it is most useful to use the pipeline
+    mode and about errors management and interaction with transactions.
 
     .. __: https://www.postgresql.org/docs/current/libpq-pipeline-mode.html
+    .. __: https://www.postgresql.org/docs/current/protocol-flow.html#PROTOCOL-FLOW-EXT-QUERY
 
 
 .. _pipeline-usage:
@@ -61,6 +68,12 @@ next :ref:`synchronization point <pipeline-sync>`; a `~errors.PipelineAborted`
 exception is raised for each such command. Query processing resumes after the
 synchronization point.
 
+Note that, even in :ref:`autocommit <autocommit>`, the server wraps the
+statements sent in pipeline mode in an implicit transaction, which will be
+only committed when the sync is received. As such, a failure in a group of
+statement will probably invalidate the effect of statements executed after the
+previous sync.
+
 .. warning::
 
     Certain features are not available in pipeline mode, including: