1SPI_PREPARE_CURSOR(3) PostgreSQL 12.2 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
20 const char * command
21 command string
22
23 int nargs
24 number of input parameters ($1, $2, etc.)
25
26 Oid * argtypes
27 pointer to an array containing the OIDs of the data types of the
28 parameters
29
30 int cursorOptions
31 integer bit mask of cursor options; zero produces default behavior
32
34 SPI_prepare_cursor has the same return conventions as SPI_prepare.
35
37 Useful bits to set in cursorOptions include CURSOR_OPT_SCROLL,
38 CURSOR_OPT_NO_SCROLL, CURSOR_OPT_FAST_PLAN, CURSOR_OPT_GENERIC_PLAN,
39 and CURSOR_OPT_CUSTOM_PLAN. Note in particular that CURSOR_OPT_HOLD is
40 ignored.
41
42
43
44PostgreSQL 12.2 2020 SPI_PREPARE_CURSOR(3)