51.71. pg_cursors
Thepg_cursors
view lists the cursors that are currently available. Cursors can be defined in several ways:
via the
DECLARE
statement in SQLvia the Bind message in the frontend/backend protocol, as described inSection 52.2.3
via the Server Programming Interface (SPI), as described inSection 46.1
Thepg_cursors
view displays cursors created by any of these means. Cursors only exist for the duration of the transaction that defines them, unless they have been declaredWITH HOLD
. Therefore non-holdable cursors are only present in the view until the end of their creating transaction.
Note
Cursors are used internally to implement some of the components ofPostgres Pro, such as procedural languages. Therefore, thepg_cursors
view might include cursors that have not been explicitly created by the user.
Table 51.72. pg_cursors
Columns
Column Type Description |
---|
The name of the cursor |
The verbatim query string submitted to declare this cursor |
|
|
|
The time at which the cursor was declared |
Thepg_cursors
view is read-only.