pg_cursors
The pg_cursors view lists the cursors that are currently available. Cursors can be defined in several ways: via the DECLARE statement in SQL via the Bind message in the frontend/backend protocol, as described in Section 54.2.3 via the Server Programming Interface (SPI), as described in Section 45.1 The pg_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 declared WITH HOLD. Therefore non-holdable cursors are only present in the view until the end of their creating transaction.
English manual coverage begins with PostgreSQL 7.4. Source history and runtime observations have their own recorded version boundaries.
Reading PG 18·Select a recorded version
- kind
- view
- lang
- en
- measured attributes
- true
- metadata release
- 18.6
- runtime columns
- name, statement, is_holdable, is_binary, is_scrollable, creation_time
- runtime verified
- false
- source
- english-manual
Definition PG 18
The pg_cursors view lists the cursors that are currently available. Cursors can be defined in several ways: via the DECLARE statement in SQL via the Bind message in the frontend/backend protocol, as described in Section 54.2.3 via the Server Programming Interface (SPI), as described in Section 45.1 The pg_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 declared WITH HOLD. Therefore non-holdable cursors are only present in the view until the end of their creating transaction.
Catalog columns
| Column | Type | Nullability | Description |
|---|---|---|---|
| name | text | Nullable | The name of the cursor |
| statement | text | Nullable | The verbatim query string submitted to declare this cursor |
| is_holdable | bool | Nullable | true if the cursor is holdable (that is, it can be accessed after the transaction that declared the cursor has committed); false otherwise |
| is_binary | bool | Nullable | true if the cursor was declared BINARY; false otherwise |
| is_scrollable | bool | Nullable | true if the cursor is scrollable (that is, it allows rows to be retrieved in a nonsequential manner); false otherwise |
| creation_time | timestamptz | Nullable | The time at which the cursor was declared |
Compare versions
Source references
Full definition and evidence JSON
Definition sources
center · PostgreSQL 18 · catalog-bilingual-repair:88d138e529a5aa8c45dbbf63affb48d6f6c25ac9a2b5c0a5b4c65d5c5510630e
Text language: en · catalog-bilingual-repair:88d138e529a5aa8c45dbbf63affb48d6f6c25ac9a2b5c0a5b4c65d5c5510630e