aboutsummaryrefslogtreecommitdiff
path: root/src/backend/tcop/postgres.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/tcop/postgres.c')
-rw-r--r--src/backend/tcop/postgres.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c
index e8d8e6f8285..1ecaba0d574 100644
--- a/src/backend/tcop/postgres.c
+++ b/src/backend/tcop/postgres.c
@@ -1270,6 +1270,13 @@ exec_simple_query(const char *query_string)
* those that start or end a transaction block.
*/
CommandCounterIncrement();
+
+ /*
+ * Disable statement timeout between queries of a multi-query
+ * string, so that the timeout applies separately to each query.
+ * (Our next loop iteration will start a fresh timeout.)
+ */
+ disable_statement_timeout();
}
/*
@@ -2135,7 +2142,10 @@ exec_execute_message(const char *portal_name, long max_rows)
*/
CommandCounterIncrement();
- /* full command has been executed, reset timeout */
+ /*
+ * Disable statement timeout whenever we complete an Execute
+ * message. The next protocol message will start a fresh timeout.
+ */
disable_statement_timeout();
}