From 6003ddd5dd7d9b0b36af7f852f2519c8e8ee670b Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Fri, 5 Oct 2018 15:20:32 +0200 Subject: [PATCH 2/2] Slightly correct context check for event triggers The previous check for a "complete query" omitted the new PROCESS_UTILITY_QUERY_NONATOMIC value. This didn't actually make a difference in practice, because only CALL and SET from PL/pgSQL run in this state, but it's more correct to include it anyway. --- src/backend/tcop/utility.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backend/tcop/utility.c b/src/backend/tcop/utility.c index b5804f64ad..d0e2d84ea2 100644 --- a/src/backend/tcop/utility.c +++ b/src/backend/tcop/utility.c @@ -943,7 +943,7 @@ ProcessUtilitySlow(ParseState *pstate, { Node *parsetree = pstmt->utilityStmt; bool isTopLevel = (context == PROCESS_UTILITY_TOPLEVEL); - bool isCompleteQuery = (context <= PROCESS_UTILITY_QUERY); + bool isCompleteQuery = (context != PROCESS_UTILITY_SUBCOMMAND); bool needCleanup; bool commandCollected = false; ObjectAddress address; -- 2.19.0