File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -833,7 +833,9 @@ Cursors
833833When a prepared statement is declared, ``ps.declare(...)``, a
834834`postgresql.api.Cursor` is created and returned for random access to the rows in
835835the result set. Direct use of cursors is primarily useful for applications that
836- need to implement paging.
836+ need to implement paging. For situations that need to iterate over the result
837+ set, the ``ps.rows(...)`` or ``ps.chunks(...)`` execution methods should be
838+ used.
837839
838840Cursors can also be created directly from ``cursor_id``'s using the
839841``cursor_from_id`` method on connection objects::
@@ -844,6 +846,10 @@ Cursors can also be created directly from ``cursor_id``'s using the
844846 [(1,)]
845847 >>> c.close()
846848
849+ .. hint::
850+ If the cursor that needs to be opened is going to be treated as an iterator,
851+ then a FETCH-statement should be prepared instead using ``cursor_from_id``.
852+
847853Like statements created from an identifier, cursors created from an identifier
848854must be explicitly closed in order to destroy the object on the server.
849855Likewise, cursors created from statement invocations will be automatically
You can’t perform that action at this time.
0 commit comments