SPI_KEEPPLAN(3)
π SPI_KEEPPLAN(3) π
okay so bestie, this one is from the PostgreSQL 13.23 Documentation and itβs lowkey iconic: itβs all about saving a prepared statement so it sticks around. periodt. π
πΈ NAME πΈ
SPI_keepplan β save a prepared statement. bestie, thatβs literally the whole vibe of this page. β¨
π¦ 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. π«Ά
this gives you the ability to reuse prepared statements in the subsequent invocations of your C function in the current session. itβs giving βkeep the thing alive so future you can use it againβ energy. π
π 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 β no data copying is required. the pointer gets adjusted, and thatβs the whole trick. π
if you later wish to delete it, use SPI_freeplan on it. donβt just leave it vibing forever unless you want to, bestie. π
alright, thatβs the page π«Ά β source and version: PostgreSQL 13.23 Documentation, dated 2025. mwah πβ¨
π¦ where this page comes from
- opensuse-leap 16.0: postgresql13-docs 13.23-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