From: Daniele Varrazzo Date: Sat, 7 May 2022 15:29:25 +0000 (+0200) Subject: docs: add note about implicit transactions and sync in pipeline mode X-Git-Tag: 3.1~120^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d34e2d69fce559b6a993133bed8d0f652b078b01;p=thirdparty%2Fpsycopg.git docs: add note about implicit transactions and sync in pipeline mode --- diff --git a/docs/advanced/pipeline.rst b/docs/advanced/pipeline.rst index d7613b12c..d13f95e0a 100644 --- a/docs/advanced/pipeline.rst +++ b/docs/advanced/pipeline.rst @@ -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 ` 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 `; a `~errors.PipelineAborted` exception is raised for each such command. Query processing resumes after the synchronization point. +Note that, even in :ref:`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: