'\" t .\" Title: SPI_push .\" Author: The PostgreSQL Global Development Group .\" Generator: DocBook XSL Stylesheets v1.79.1 .\" Date: 2019 .\" Manual: PostgreSQL 9.6.12 Documentation .\" Source: PostgreSQL 9.6.12 .\" Language: English .\" .TH "SPI_PUSH" "3" "2019" "PostgreSQL 9.6.12" "PostgreSQL 9.6.12 Documentation" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" SPI_push \- push SPI stack to allow recursive SPI usage .SH "SYNOPSIS" .sp .nf void SPI_push(void) .fi .SH "DESCRIPTION" .PP \fBSPI_push\fR should be called before executing another procedure that might itself wish to use SPI\&. After \fBSPI_push\fR, SPI is no longer in a \(lqconnected\(rq state, and SPI function calls will be rejected unless a fresh \fBSPI_connect\fR is done\&. This ensures a clean separation between your procedure\*(Aqs SPI state and that of another procedure you call\&. After the other procedure returns, call \fBSPI_pop\fR to restore access to your own SPI state\&. .PP Note that \fBSPI_execute\fR and related functions automatically do the equivalent of \fBSPI_push\fR 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 \fBSPI_connect\fR calls do you need to issue \fBSPI_push\fR and \fBSPI_pop\fR\&.