]> begriffs open source - ai-pg/blob - full-docs/man3/SPI_keepplan.3
Convert HTML docs to more streamlined TXT
[ai-pg] / full-docs / man3 / SPI_keepplan.3
1 '\" t
2 .\"     Title: SPI_keepplan
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_KEEPPLAN" "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_keepplan \- save a prepared statement
32 .SH "SYNOPSIS"
33 .sp
34 .nf
35 int SPI_keepplan(SPIPlanPtr \fIplan\fR)
36 .fi
37 .SH "DESCRIPTION"
38 .PP
39 \fBSPI_keepplan\fR
40 saves a passed statement (prepared by
41 \fBSPI_prepare\fR) so that it will not be freed by
42 \fBSPI_finish\fR
43 nor by the transaction manager\&. This gives you the ability to reuse prepared statements in the subsequent invocations of your C function in the current session\&.
44 .SH "ARGUMENTS"
45 .PP
46 SPIPlanPtr \fIplan\fR
47 .RS 4
48 the prepared statement to be saved
49 .RE
50 .SH "RETURN VALUE"
51 .PP
52 0 on success;
53 SPI_ERROR_ARGUMENT
54 if
55 \fIplan\fR
56 is
57 NULL
58 or invalid
59 .SH "NOTES"
60 .PP
61 The passed\-in statement is relocated to permanent storage by means of pointer adjustment (no data copying is required)\&. If you later wish to delete it, use
62 \fBSPI_freeplan\fR
63 on it\&.