]> begriffs open source - ai-pg/blob - full-docs/man3/SPI_prepare_cursor.3
Convert HTML docs to more streamlined TXT
[ai-pg] / full-docs / man3 / SPI_prepare_cursor.3
1 '\" t
2 .\"     Title: SPI_prepare_cursor
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_PREPARE_CURSOR" "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_prepare_cursor \- prepare a statement, without executing it yet
32 .SH "SYNOPSIS"
33 .sp
34 .nf
35 SPIPlanPtr SPI_prepare_cursor(const char * \fIcommand\fR, int \fInargs\fR,
36                               Oid * \fIargtypes\fR, int \fIcursorOptions\fR)
37 .fi
38 .SH "DESCRIPTION"
39 .PP
40 \fBSPI_prepare_cursor\fR
41 is identical to
42 \fBSPI_prepare\fR, except that it also allows specification of the planner\*(Aqs
43 \(lqcursor options\(rq
44 parameter\&. This is a bit mask having the values shown in
45 nodes/parsenodes\&.h
46 for the
47 options
48 field of
49 DeclareCursorStmt\&.
50 \fBSPI_prepare\fR
51 always takes the cursor options as zero\&.
52 .PP
53 This function is now deprecated in favor of
54 \fBSPI_prepare_extended\fR\&.
55 .SH "ARGUMENTS"
56 .PP
57 const char * \fIcommand\fR
58 .RS 4
59 command string
60 .RE
61 .PP
62 int \fInargs\fR
63 .RS 4
64 number of input parameters ($1,
65 $2, etc\&.)
66 .RE
67 .PP
68 Oid * \fIargtypes\fR
69 .RS 4
70 pointer to an array containing the
71 OIDs of the data types of the parameters
72 .RE
73 .PP
74 int \fIcursorOptions\fR
75 .RS 4
76 integer bit mask of cursor options; zero produces default behavior
77 .RE
78 .SH "RETURN VALUE"
79 .PP
80 \fBSPI_prepare_cursor\fR
81 has the same return conventions as
82 \fBSPI_prepare\fR\&.
83 .SH "NOTES"
84 .PP
85 Useful bits to set in
86 \fIcursorOptions\fR
87 include
88 CURSOR_OPT_SCROLL,
89 CURSOR_OPT_NO_SCROLL,
90 CURSOR_OPT_FAST_PLAN,
91 CURSOR_OPT_GENERIC_PLAN, and
92 CURSOR_OPT_CUSTOM_PLAN\&. Note in particular that
93 CURSOR_OPT_HOLD
94 is ignored\&.