pg_cursors — PostgreSQL system view

The PostgreSQL pg_cursors system view: full column reference (names, types, descriptions), catalog relationships and version support.

Summary

The pg_cursors view lists the cursors that are currently available. Cursors can be defined in several ways: via the DECLARE statement in SQL

(Description quoted from the official PostgreSQL documentation.)

Columns

The pg_cursors system view exposes the following columns (names, types and descriptions are taken verbatim from the PostgreSQL documentation):

  • name text
    The name of the cursor
  • statement text
    The verbatim query string submitted to declare this cursor
  • is_holdable bool
    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
    true if the cursor was declared BINARY; false otherwise
  • is_scrollable bool
    true if the cursor is scrollable (that is, it allows rows to be retrieved in a nonsequential manner); false otherwise
  • creation_time timestamptz
    The time at which the cursor was declared

Version applicability

Present in PostgreSQL 17, 18, 19 (verified against each release’s documentation). This is a long-standing system object that also exists in earlier PostgreSQL releases.

Related & references

Reference: PostgreSQL documentation — pg_cursors.