SPI_KEEPPLAN(3)
π SPI_KEEPPLAN(3) π
okay so this is the SPI_KEEPPLAN(3) page from the PostgreSQL 14.24 Documentation, and itβs lowkey iconic for anyone writing C functions that need a prepared statement to stay put across calls. bestie, this is the βdonβt free my planβ button π«Άβ¨
β¨ NAME β¨
SPI_keepplan β save a prepared statement, periodt πΎπ
π¦ 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. no cap, thatβs the whole vibe π₯
This gives you the ability to reuse prepared statements in the subsequent invocations of your C function in the current session. literally the βkeep it for laterβ main character move ππ«
π ARGUMENTS π
SPIPlanPtr planβ the prepared statement to be saved π
β RETURN VALUE β
0on success πSPI_ERROR_ARGUMENTifplanisNULLor invalid π
π NOTES π
The passed-in statement is relocated to permanent storage by means of pointer adjustment β and ngl, no data copying is required π§β¨. If you later wish to delete it, use SPI_freeplan on it. thatβs the cleanup era π
big mwah π β this oneβs from PostgreSQL 14.24, dated 2026, and itβs the SPI_KEEPPLAN(3) page, periodt ππ«Ά
π¦ where this page comes from
- opensuse-leap 16.0: postgresql14-docs 14.24-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