should be called before executing another procedure that might itself wish to use SPI. After
SPI_push, SPI is no longer in a
state, and SPI function calls will be rejected unless a fresh
is done. This ensures a clean separation between your procedures SPI state and that of another procedure you call. After the other procedure returns, call
to restore access to your own SPI state.
and related functions automatically do the equivalent of
before passing control back to the SQL execution engine, so it is not necessary for you to worry about this when using those functions. Only when you are directly calling arbitrary code that might contain
calls do you need to issue