]> begriffs open source - ai-pg/blob - full-docs/man3/SPI_is_cursor_plan.3
Convert HTML docs to more streamlined TXT
[ai-pg] / full-docs / man3 / SPI_is_cursor_plan.3
1 '\" t
2 .\"     Title: SPI_is_cursor_plan
3 .\"    Author: The PostgreSQL Global Development Group
4 .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
5 .\"      Date: 2025
6 .\"    Manual: PostgreSQL 18.0 Documentation
7 .\"    Source: PostgreSQL 18.0
8 .\"  Language: English
9 .\"
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 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
18 .ie \n(.g .ds Aq \(aq
19 .el       .ds Aq '
20 .\" -----------------------------------------------------------------
21 .\" * set default formatting
22 .\" -----------------------------------------------------------------
23 .\" disable hyphenation
24 .nh
25 .\" disable justification (adjust text to left margin only)
26 .ad l
27 .\" -----------------------------------------------------------------
28 .\" * MAIN CONTENT STARTS HERE *
29 .\" -----------------------------------------------------------------
30 .SH "NAME"
31 SPI_is_cursor_plan \- return true if a statement prepared by \fBSPI_prepare\fR can be used with \fBSPI_cursor_open\fR
32 .SH "SYNOPSIS"
33 .sp
34 .nf
35 bool SPI_is_cursor_plan(SPIPlanPtr \fIplan\fR)
36 .fi
37 .SH "DESCRIPTION"
38 .PP
39 \fBSPI_is_cursor_plan\fR
40 returns
41 true
42 if a statement prepared by
43 \fBSPI_prepare\fR
44 can be passed as an argument to
45 \fBSPI_cursor_open\fR, or
46 false
47 if that is not the case\&. The criteria are that the
48 \fIplan\fR
49 represents one single command and that this command returns tuples to the caller; for example,
50 \fBSELECT\fR
51 is allowed unless it contains an
52 INTO
53 clause, and
54 \fBUPDATE\fR
55 is allowed only if it contains a
56 RETURNING
57 clause\&.
58 .SH "ARGUMENTS"
59 .PP
60 SPIPlanPtr \fIplan\fR
61 .RS 4
62 prepared statement (returned by
63 \fBSPI_prepare\fR)
64 .RE
65 .SH "RETURN VALUE"
66 .PP
67 true
68 or
69 false
70 to indicate if the
71 \fIplan\fR
72 can produce a cursor or not, with
73 \fISPI_result\fR
74 set to zero\&. If it is not possible to determine the answer (for example, if the
75 \fIplan\fR
76 is
77 NULL
78 or invalid, or if called when not connected to SPI), then
79 \fISPI_result\fR
80 is set to a suitable error code and
81 false
82 is returned\&.