SPI_KEEPPLAN(3)
π SPI_KEEPPLAN(3) β save a prepared statement π
okay so bestie, welcome to the PostgreSQL 17.11 Documentation page for SPI_KEEPPLAN(3). This one is short, sweet, and honestly kind of iconic: itβs all about keeping a prepared statement alive so it doesnβt get swept away. Letβs get into it β¨
β¨ SYNOPSIS β¨
int SPI_keepplan(SPIPlanPtr plan)
π«Ά DESCRIPTION π«Ά
SPI_keepplan saves a passed statement β one that was prepared by SPI_prepare β so that it will not be freed by SPI_finish nor by the transaction manager. periodt. This gives you the ability to reuse prepared statements in the subsequent invocations of your C function in the current session. literally so useful π«Ά
π ARGUMENTS π
SPIPlanPtr planβ the prepared statement to be saved. thatβs the one youβre tucking into safety π
π RETURN VALUE π
0on success.SPI_ERROR_ARGUMENTifplanisNULLor invalid.
π₯ NOTES π₯
The passed-in statement is relocated to permanent storage by means of pointer adjustment β no data copying is required. iconic efficiency, no cap π
If you later wish to delete it, use SPI_freeplan on it. donβt just leave it vibing forever, bestie π
PostgreSQL 17.11 Β· 2026 Β· SPI_KEEPPLAN(3) β bye bestie, mwah π
π¦ where this page comes from
- opensuse-leap 16.0: postgresql17-docs 17.11-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