| PostgreSQL 8.3.3 Documentation | ||||
|---|---|---|---|---|
| Prev | Fast Backward | Fast Forward | Next | |
SPI_saveplan saves a passed plan (prepared by SPI_prepare) in memory that will not be freed by SPI_finish nor by the transaction manager, and returns a pointer to the saved plan. This gives you the ability to reuse prepared plans in the subsequent invocations of your procedure in the current session.
Pointer to the saved plan; NULL if unsuccessful. On error, SPI_result is set thus:
if plan is NULL or invalid
if called from an unconnected procedure
The passed-in plan is not freed, so you might wish to do SPI_freeplan on it to avoid leaking memory until SPI_finish.
If one of the objects (a table, function, etc.) referenced by the prepared plan is dropped or redefined, then future executions of SPI_execute_plan may fail or return different results than the plan initially indicates.
No comments could be found for this page.
Please use this form to add your own comments regarding your experience with particular features of PostgreSQL, clarifications of the documentation, or hints for other users. Please note, this is not a support forum, and your IP address will be logged. If you have a question or need help, please see the faq, try a mailing list, or join us on IRC. Note that submissions containing URLs or other keywords commonly found in 'spam' comments may be silently discarded. Please contact the webmaster if you think this is happening to you in error.
In order to submit a comment, you must have a community account.
* denotes required field