SPI_KEEPPLAN(3)

πŸ“¦ version 15.19, in opensuse-leap 16.0

πŸŽ€ 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 🌈

  • 0 on success
  • SPI_ERROR_ARGUMENT if plan is NULL or 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