2 .\" Title: SPI_prepare_extended
3 .\" Author: The PostgreSQL Global Development Group
4 .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
6 .\" Manual: PostgreSQL 18.0 Documentation
7 .\" Source: PostgreSQL 18.0
10 .TH "SPI_PREPARE_EXTENDED" "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 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
20 .\" -----------------------------------------------------------------
21 .\" * set default formatting
22 .\" -----------------------------------------------------------------
23 .\" disable hyphenation
25 .\" disable justification (adjust text to left margin only)
27 .\" -----------------------------------------------------------------
28 .\" * MAIN CONTENT STARTS HERE *
29 .\" -----------------------------------------------------------------
31 SPI_prepare_extended \- prepare a statement, without executing it yet
35 SPIPlanPtr SPI_prepare_extended(const char * \fIcommand\fR,
36 const SPIPrepareOptions * \fIoptions\fR)
40 \fBSPI_prepare_extended\fR
41 creates and returns a prepared statement for the specified command, but doesn\*(Aqt execute the command\&. This function is equivalent to
42 \fBSPI_prepare\fR, with the addition that the caller can specify options to control the parsing of external parameter references, as well as other facets of query parsing and planning\&.
45 const char * \fIcommand\fR
50 const SPIPrepareOptions * \fIoptions\fR
52 struct containing optional arguments
55 Callers should always zero out the entire
57 struct, then fill whichever fields they want to set\&. This ensures forward compatibility of code, since any fields that are added to the struct in future will be defined to behave backwards\-compatibly if they are zero\&. The currently available
61 ParserSetupHook \fIparserSetup\fR
63 Parser hook setup function
66 void * \fIparserSetupArg\fR
68 pass\-through argument for
72 RawParseMode \fIparseMode\fR
76 (zero) produces default behavior
79 int \fIcursorOptions\fR
81 integer bit mask of cursor options; zero produces default behavior
85 \fBSPI_prepare_extended\fR
86 has the same return conventions as