*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/executor/spi.c,v 1.104 2003/09/16 00:50:09 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/executor/spi.c,v 1.105 2003/09/23 15:11:33 tgl Exp $
*
*-------------------------------------------------------------------------
*/
elog(ERROR, "invalid portal in SPI cursor operation");
/* Push the SPI stack */
- _SPI_begin_call(true);
+ if (_SPI_begin_call(true) < 0)
+ elog(ERROR, "SPI cursor operation called while not connected");
/* Reset the SPI result */
SPI_processed = 0;
}
/*
- * _SPI_begin_call
- *
+ * _SPI_begin_call: begin a SPI operation within a connected procedure
*/
static int
_SPI_begin_call(bool execmem)
return 0;
}
+/*
+ * _SPI_end_call: end a SPI operation within a connected procedure
+ *
+ * Note: this currently has no failure return cases, so callers don't check
+ */
static int
_SPI_end_call(bool procmem)
{