aboutsummaryrefslogtreecommitdiff
path: root/src/include/executor/spi_priv.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/executor/spi_priv.h')
-rw-r--r--src/include/executor/spi_priv.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/include/executor/spi_priv.h b/src/include/executor/spi_priv.h
index faa81dbb7f8..ef7903abd09 100644
--- a/src/include/executor/spi_priv.h
+++ b/src/include/executor/spi_priv.h
@@ -59,6 +59,12 @@ typedef struct
* while additional data such as argtypes and list cells is loose in the SPI
* executor context. Such plans can be identified by having plancxt == NULL.
*
+ * We can also have "one-shot" SPI plans (which are typically temporary,
+ * as described above). These are meant to be executed once and discarded,
+ * and various optimizations are made on the assumption of single use.
+ * Note in particular that the CachedPlanSources within such an SPI plan
+ * are not "complete" until execution.
+ *
* Note: if the original query string contained only whitespace and comments,
* the plancache_list will be NIL and so there is no place to store the
* query string. We don't care about that, but we do care about the
@@ -68,6 +74,7 @@ typedef struct _SPI_plan
{
int magic; /* should equal _SPI_PLAN_MAGIC */
bool saved; /* saved or unsaved plan? */
+ bool oneshot; /* one-shot plan? */
List *plancache_list; /* one CachedPlanSource per parsetree */
MemoryContext plancxt; /* Context containing _SPI_plan and data */
int cursor_options; /* Cursor options used for planning */