4 The pg_cursors view lists the cursors that are currently available.
5 Cursors can be defined in several ways:
6 * via the DECLARE statement in SQL
7 * via the Bind message in the frontend/backend protocol, as described
9 * via the Server Programming Interface (SPI), as described in
12 The pg_cursors view displays cursors created by any of these means.
13 Cursors only exist for the duration of the transaction that defines
14 them, unless they have been declared WITH HOLD. Therefore non-holdable
15 cursors are only present in the view until the end of their creating
20 Cursors are used internally to implement some of the components of
21 PostgreSQL, such as procedural languages. Therefore, the pg_cursors
22 view might include cursors that have not been explicitly created by the
25 Table 53.7. pg_cursors Columns
33 The name of the cursor
37 The verbatim query string submitted to declare this cursor
41 true if the cursor is holdable (that is, it can be accessed after the
42 transaction that declared the cursor has committed); false otherwise
46 true if the cursor was declared BINARY; false otherwise
50 true if the cursor is scrollable (that is, it allows rows to be
51 retrieved in a nonsequential manner); false otherwise
53 creation_time timestamptz
55 The time at which the cursor was declared
57 The pg_cursors view is read-only.