SPI_KEEPPLAN(3)
π NAME π
okay bestie, welcome to the SPI_KEEPPLAN(3) page β it's literally about saving a prepared statement, and the vibe is very βkeep that plan, protect that planβ π
β¨.
β¨ SYNOPSIS β¨
int SPI_keepplan(SPIPlanPtr plan)
π DESCRIPTION π
SPI_keepplan saves a passed-in statement (one prepared by SPI_prepare) so it will not be freed by SPI_finish and it will not be freed by the transaction manager either. no cap. That gives you the ability to reuse prepared statements in the subsequent invocations of your C function in the current session. it's giving reusable, it's giving persistent, it's giving main character energy π.
π«Ά ARGUMENTS π«Ά
SPIPlanPtr planβ the prepared statement to be saved. that's the one, bestie π«Ά
π RETURN VALUE π
0on successSPI_ERROR_ARGUMENTifplanisNULLor invalid
π NOTES π
The passed-in statement is relocated to permanent storage by means of pointer adjustment (no data copying is required β we love an efficient queen β¨). If you later wish to delete it, use SPI_freeplan on it. periodt.
PostgreSQL 15.19 Documentation Β· 2026 Β· that's the whole page, bestie, mwah π
π¦ where this page comes from
- opensuse-leap 16.0: postgresql15-docs 15.19-160000.1.1 Β· PostgreSQL
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms