aboutsummaryrefslogtreecommitdiff
path: root/src/include/executor
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2004-11-16 18:10:16 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2004-11-16 18:10:16 +0000
commit7efa8411cc56383a9b7ac2203f310d0db81f0580 (patch)
treea205f416cfee9d6c54864d06c72a2aa6f686f9e6 /src/include/executor
parent2bb3bcfcf9edb57d7bd3635b2201688defee6676 (diff)
downloadpostgresql-7efa8411cc56383a9b7ac2203f310d0db81f0580.tar.gz
postgresql-7efa8411cc56383a9b7ac2203f310d0db81f0580.zip
Rethink plpgsql's way of handling SPI execution during an exception block.
We don't really want to start a new SPI connection, just keep using the old one; otherwise we have memory management problems as illustrated by John Kennedy's bug report of today. This requires a bit of a hack to ensure the SPI stack state is properly restored, but then again what we were doing before was a hack too, strictly speaking. Add a regression test to cover this case.
Diffstat (limited to 'src/include/executor')
-rw-r--r--src/include/executor/spi.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/include/executor/spi.h b/src/include/executor/spi.h
index 3014dbce840..d5ba89fa3ea 100644
--- a/src/include/executor/spi.h
+++ b/src/include/executor/spi.h
@@ -2,7 +2,7 @@
*
* spi.h
*
- * $PostgreSQL: pgsql/src/include/executor/spi.h,v 1.49 2004/09/16 16:58:40 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/executor/spi.h,v 1.50 2004/11/16 18:10:13 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -81,6 +81,7 @@ extern int SPI_connect(void);
extern int SPI_finish(void);
extern void SPI_push(void);
extern void SPI_pop(void);
+extern void SPI_restore_connection(void);
extern int SPI_execute(const char *src, bool read_only, int tcount);
extern int SPI_execute_plan(void *plan, Datum *Values, const char *Nulls,
bool read_only, int tcount);