summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorPeter Eisentraut2018-03-24 14:05:06 +0000
committerPeter Eisentraut2018-03-28 17:31:27 +0000
commitd92bc83c48bdea9888e64cf1e2edbac9693099c9 (patch)
tree5cccf082581787b24af269613fb7b3cc4c4484d7 /src/include
parentc2d4eb1b1fa252fd8c407e1519308017a18afed1 (diff)
PL/pgSQL: Nested CALL with transactions
So far, a nested CALL or DO in PL/pgSQL would not establish a context where transaction control statements were allowed. This fixes that by handling CALL and DO specially in PL/pgSQL, passing the atomic/nonatomic execution context through and doing the required management around transaction boundaries. Reviewed-by: Tomas Vondra <tomas.vondra@2ndquadrant.com>
Diffstat (limited to 'src/include')
-rw-r--r--src/include/executor/spi_priv.h1
-rw-r--r--src/include/tcop/utility.h1
2 files changed, 2 insertions, 0 deletions
diff --git a/src/include/executor/spi_priv.h b/src/include/executor/spi_priv.h
index 263c8f14539..376fae0bbc4 100644
--- a/src/include/executor/spi_priv.h
+++ b/src/include/executor/spi_priv.h
@@ -86,6 +86,7 @@ typedef struct _SPI_plan
int magic; /* should equal _SPI_PLAN_MAGIC */
bool saved; /* saved or unsaved plan? */
bool oneshot; /* one-shot plan? */
+ bool no_snapshots; /* let the caller handle the snapshots */
List *plancache_list; /* one CachedPlanSource per parsetree */
MemoryContext plancxt; /* Context containing _SPI_plan and data */
int cursor_options; /* Cursor options used for planning */
diff --git a/src/include/tcop/utility.h b/src/include/tcop/utility.h
index 55500557109..880d19311a6 100644
--- a/src/include/tcop/utility.h
+++ b/src/include/tcop/utility.h
@@ -20,6 +20,7 @@ typedef enum
{
PROCESS_UTILITY_TOPLEVEL, /* toplevel interactive command */
PROCESS_UTILITY_QUERY, /* a complete query, but not toplevel */
+ PROCESS_UTILITY_QUERY_NONATOMIC, /* a complete query, nonatomic execution context */
PROCESS_UTILITY_SUBCOMMAND /* a portion of a query */
} ProcessUtilityContext;