]> begriffs open source - ai-pg/blob - full-docs/src/sgml/man3/SPI_prepare_extended.3
WIP: toc builder
[ai-pg] / full-docs / src / sgml / man3 / SPI_prepare_extended.3
1 '\" t
2 .\"     Title: SPI_prepare_extended
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_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 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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_extended \- prepare a statement, without executing it yet
32 .SH "SYNOPSIS"
33 .sp
34 .nf
35 SPIPlanPtr SPI_prepare_extended(const char * \fIcommand\fR,
36                                 const SPIPrepareOptions * \fIoptions\fR)
37 .fi
38 .SH "DESCRIPTION"
39 .PP
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\&.
43 .SH "ARGUMENTS"
44 .PP
45 const char * \fIcommand\fR
46 .RS 4
47 command string
48 .RE
49 .PP
50 const SPIPrepareOptions * \fIoptions\fR
51 .RS 4
52 struct containing optional arguments
53 .RE
54 .PP
55 Callers should always zero out the entire
56 \fIoptions\fR
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
58 \fIoptions\fR
59 fields are:
60 .PP
61 ParserSetupHook \fIparserSetup\fR
62 .RS 4
63 Parser hook setup function
64 .RE
65 .PP
66 void * \fIparserSetupArg\fR
67 .RS 4
68 pass\-through argument for
69 \fIparserSetup\fR
70 .RE
71 .PP
72 RawParseMode \fIparseMode\fR
73 .RS 4
74 mode for raw parsing;
75 RAW_PARSE_DEFAULT
76 (zero) produces default behavior
77 .RE
78 .PP
79 int \fIcursorOptions\fR
80 .RS 4
81 integer bit mask of cursor options; zero produces default behavior
82 .RE
83 .SH "RETURN VALUE"
84 .PP
85 \fBSPI_prepare_extended\fR
86 has the same return conventions as
87 \fBSPI_prepare\fR\&.