1SPI_PREPARE_CURSOR(3) PostgreSQL 15.4 Documentation SPI_PREPARE_CURSOR(3)
2
3
4
6 SPI_prepare_cursor - prepare a statement, without executing it yet
7
9 SPIPlanPtr SPI_prepare_cursor(const char * command, int nargs,
10 Oid * argtypes, int cursorOptions)
11
13 SPI_prepare_cursor is identical to SPI_prepare, except that it also
14 allows specification of the planner's “cursor options” parameter. This
15 is a bit mask having the values shown in nodes/parsenodes.h for the
16 options field of DeclareCursorStmt. SPI_prepare always takes the
17 cursor options as zero.
18
19 This function is now deprecated in favor of SPI_prepare_extended.
20
22 const char * command
23 command string
24
25 int nargs
26 number of input parameters ($1, $2, etc.)
27
28 Oid * argtypes
29 pointer to an array containing the OIDs of the data types of the
30 parameters
31
32 int cursorOptions
33 integer bit mask of cursor options; zero produces default behavior
34
36 SPI_prepare_cursor has the same return conventions as SPI_prepare.
37
39 Useful bits to set in cursorOptions include CURSOR_OPT_SCROLL,
40 CURSOR_OPT_NO_SCROLL, CURSOR_OPT_FAST_PLAN, CURSOR_OPT_GENERIC_PLAN,
41 and CURSOR_OPT_CUSTOM_PLAN. Note in particular that CURSOR_OPT_HOLD is
42 ignored.
43
44
45
46PostgreSQL 15.4 2023 SPI_PREPARE_CURSOR(3)