1SPI_PREPARE_EXTENDED(3) PostgreSQL 15.4 Documentation SPI_PREPARE_EXTENDED(3)
2
3
4
6 SPI_prepare_extended - prepare a statement, without executing it yet
7
9 SPIPlanPtr SPI_prepare_extended(const char * command,
10 const SPIPrepareOptions * options)
11
13 SPI_prepare_extended creates and returns a prepared statement for the
14 specified command, but doesn't execute the command. This function is
15 equivalent to SPI_prepare, with the addition that the caller can
16 specify options to control the parsing of external parameter
17 references, as well as other facets of query parsing and planning.
18
20 const char * command
21 command string
22
23 const SPIPrepareOptions * options
24 struct containing optional arguments
25
26 Callers should always zero out the entire options struct, then fill
27 whichever fields they want to set. This ensures forward compatibility
28 of code, since any fields that are added to the struct in future will
29 be defined to behave backwards-compatibly if they are zero. The
30 currently available options fields are:
31
32 ParserSetupHook parserSetup
33 Parser hook setup function
34
35 void * parserSetupArg
36 pass-through argument for parserSetup
37
38 RawParseMode parseMode
39 mode for raw parsing; RAW_PARSE_DEFAULT (zero) produces default
40 behavior
41
42 int cursorOptions
43 integer bit mask of cursor options; zero produces default behavior
44
46 SPI_prepare_extended has the same return conventions as SPI_prepare.
47
48
49
50PostgreSQL 15.4 2023 SPI_PREPARE_EXTENDED(3)