1SPI_KEEPPLAN(3)          PostgreSQL 11.3 Documentation         SPI_KEEPPLAN(3)
2
3
4

NAME

6       SPI_keepplan - save a prepared statement
7

SYNOPSIS

9       int SPI_keepplan(SPIPlanPtr plan)
10

DESCRIPTION

12       SPI_keepplan saves a passed statement (prepared by SPI_prepare) so that
13       it will not be freed by SPI_finish nor by the transaction manager. This
14       gives you the ability to reuse prepared statements in the subsequent
15       invocations of your C function in the current session.
16

ARGUMENTS

18       SPIPlanPtr plan
19           the prepared statement to be saved
20

RETURN VALUE

22       0 on success; SPI_ERROR_ARGUMENT if plan is NULL or invalid
23

NOTES

25       The passed-in statement is relocated to permanent storage by means of
26       pointer adjustment (no data copying is required). If you later wish to
27       delete it, use SPI_freeplan on it.
28
29
30
31PostgreSQL 11.3                      2019                      SPI_KEEPPLAN(3)
Impressum