2 .\" Title: SPI_is_cursor_plan
3 .\" Author: The PostgreSQL Global Development Group
4 .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
6 .\" Manual: PostgreSQL 18.0 Documentation
7 .\" Source: PostgreSQL 18.0
10 .TH "SPI_IS_CURSOR_PLAN" "3" "2025" "PostgreSQL 18.0" "PostgreSQL 18.0 Documentation"
11 .\" -----------------------------------------------------------------
12 .\" * Define some portability stuff
13 .\" -----------------------------------------------------------------
14 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15 .\" http://bugs.debian.org/507673
16 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
17 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
20 .\" -----------------------------------------------------------------
21 .\" * set default formatting
22 .\" -----------------------------------------------------------------
23 .\" disable hyphenation
25 .\" disable justification (adjust text to left margin only)
27 .\" -----------------------------------------------------------------
28 .\" * MAIN CONTENT STARTS HERE *
29 .\" -----------------------------------------------------------------
31 SPI_is_cursor_plan \- return true if a statement prepared by \fBSPI_prepare\fR can be used with \fBSPI_cursor_open\fR
35 bool SPI_is_cursor_plan(SPIPlanPtr \fIplan\fR)
39 \fBSPI_is_cursor_plan\fR
42 if a statement prepared by
44 can be passed as an argument to
45 \fBSPI_cursor_open\fR, or
47 if that is not the case\&. The criteria are that the
49 represents one single command and that this command returns tuples to the caller; for example,
51 is allowed unless it contains an
55 is allowed only if it contains a
62 prepared statement (returned by
72 can produce a cursor or not, with
74 set to zero\&. If it is not possible to determine the answer (for example, if the
78 or invalid, or if called when not connected to SPI), then
80 is set to a suitable error code and