Document SPI_push() and SPI_pop().
authorBruce Momjian
Wed, 17 Mar 2004 01:05:10 +0000 (01:05 +0000)
committerBruce Momjian
Wed, 17 Mar 2004 01:05:10 +0000 (01:05 +0000)
doc/src/sgml/spi.sgml
src/backend/executor/spi.c
src/include/executor/spi.h

index ad8a5f084f929e613fa488c5fa92fdedc248201f..c87a136bdd471fe89a8a1e4ef6595fdf45ecdd84 100644 (file)
@@ -1,5 +1,5 @@
 
 
 
@@ -199,6 +199,68 @@ int SPI_finish(void)
 
 
 
+
+  SPI_push
+
+  SPI_push
+  pushes SPI stack to allow recursive SPI calls
+
SPI_push
+
+
+void SPI_push(void)
+
+
+  Description
+
+  
+   SPI_push pushes a new environment on to the 
+   SPI call stack, allowing recursive calls to use a new environment.
+  
+
+
+
+
+
+
+  SPI_pop
+
+  SPI_pop
+  pops SPI stack to allow recursive SPI calls
+
SPI_pop
+
+
+void SPI_pop(void)
+
+
+  Description
+
+  
+   SPI_pop pops the previous environment from the 
+   SPI call stack.  For use when returning from recursive SPI calls.
+  
+
+
+
+
+
 
  
   SPI_exec
index 128a063f3c60fcc1edd2b7cd5dd1b3fd6d457666..fb44d9d56fd02922ded6acbce74025a1736cf10d 100644 (file)
@@ -8,7 +8,7 @@
  *
  *
  * IDENTIFICATION
- *   $PostgreSQL: pgsql/src/backend/executor/spi.c,v 1.110 2004/03/05 00:47:01 momjian Exp $
+ *   $PostgreSQL: pgsql/src/backend/executor/spi.c,v 1.111 2004/03/17 01:05:10 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -201,12 +201,14 @@ AtEOXact_SPI(bool isCommit)
    SPI_tuptable = NULL;
 }
 
+/* Pushes SPI stack to allow recursive SPI calls */
 void
 SPI_push(void)
 {
    _SPI_curid++;
 }
 
+/* Pops SPI stack to allow recursive SPI calls */
 void
 SPI_pop(void)
 {
index 6d0ce059a20a7140a2c9072356ba1c9458d84b3a..ac2b494b53231fa3d2a561c650ce426396784730 100644 (file)
@@ -2,7 +2,7 @@
  *
  * spi.h
  *
- * $PostgreSQL: pgsql/src/include/executor/spi.h,v 1.42 2004/03/05 00:47:01 momjian Exp $
+ * $PostgreSQL: pgsql/src/include/executor/spi.h,v 1.43 2004/03/17 01:05:10 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -81,8 +81,8 @@ extern int    SPI_connect(void);
 extern int SPI_finish(void);
 extern void SPI_push(void);
 extern void SPI_pop(void);
-extern int SPI_exec(const char *src, int tcount);
-extern int SPI_execp(void *plan, Datum *values, const char *Nulls,
+extern int  SPI_exec(const char *src, int tcount);
+extern int  SPI_execp(void *plan, Datum *values, const char *Nulls,
          int tcount);
 extern int SPI_execp_current(void *plan, Datum *values, const char *Nulls,
                             bool useCurrentSnapshot, int tcount);