]> git.ipfire.org Git - thirdparty/psycopg.git/commitdiff
docs: drop example about using nextset() in pipeline mode
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>
Tue, 1 Aug 2023 11:04:33 +0000 (12:04 +0100)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Tue, 1 Aug 2023 11:05:53 +0000 (12:05 +0100)
The feature is sort of accidental, not tested, and proved to be not
reliable, so we will remove it in 3.2.

See #604.

docs/advanced/pipeline.rst

index 980fea70def7b1c23ee667b389df8b07283f2b47..a56049ccbd28f0fc0012563a00b4e3c2617cf409 100644 (file)
@@ -185,26 +185,8 @@ several operations, using `Connection.execute()`, `Cursor.execute()` and
 
 Unlike in normal mode, Psycopg will not wait for the server to receive the
 result of each query; the client will receive results in batches when the
-server flushes it output buffer.
-
-When a flush (or a sync) is performed, all pending results are sent back to
-the cursors which executed them. If a cursor had run more than one query, it
-will receive more than one result; results after the first will be available,
-in their execution order, using `~Cursor.nextset()`:
-
-.. code:: python
-
-    >>> with conn.pipeline():
-    ...     with conn.cursor() as cur:
-    ...        cur.execute("INSERT INTO mytable (data) VALUES (%s) RETURNING *", ["hello"])
-    ...        cur.execute("INSERT INTO mytable (data) VALUES (%s) RETURNING *", ["world"])
-    ...        while True:
-    ...            print(cur.fetchall())
-    ...            if not cur.nextset():
-    ...                break
-
-    [(1, 'hello')]
-    [(2, 'world')]
+server flushes it output buffer. You can receive more than a single result
+by using more than one cursor in the same pipeline.
 
 If any statement encounters an error, the server aborts the current
 transaction and will not execute any subsequent command in the queue until the