From b6440a7ece2cf729b27052c6cfd7e837a1eb74eb Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Tue, 30 Jul 2002 05:13:06 +0000 Subject: [PATCH] Make statement_timeout apply to entire query string, not per statement. --- src/backend/tcop/postgres.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c index 8128487a2e..53f6316d98 100644 --- a/src/backend/tcop/postgres.c +++ b/src/backend/tcop/postgres.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.273 2002/07/29 22:14:11 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.274 2002/07/30 05:13:06 momjian Exp $ * * NOTES * this is the "main" module of the postgres backend and @@ -704,6 +704,9 @@ pg_exec_query_string(StringInfo query_string, /* string to execute */ */ MemoryContextSwitchTo(oldcontext); + if (StatementTimeout) + enable_sig_alarm(StatementTimeout, true); + /* * Inner loop handles the individual queries generated from a * single parsetree by analysis and rewrite. @@ -719,9 +722,6 @@ pg_exec_query_string(StringInfo query_string, /* string to execute */ xact_started = true; } - if (StatementTimeout) - enable_sig_alarm(StatementTimeout, true); - /* * If we got a cancel signal in analysis or prior command, * quit @@ -796,8 +796,6 @@ pg_exec_query_string(StringInfo query_string, /* string to execute */ ShowUsage("EXECUTOR STATISTICS"); } - disable_sig_alarm(true); - /* * In a query block, we want to increment the command counter * between queries so that the effects of early queries are @@ -830,6 +828,8 @@ pg_exec_query_string(StringInfo query_string, /* string to execute */ } } /* end loop over queries generated from a parsetree */ + disable_sig_alarm(true); + /* * If this is the last parsetree of the query string, close down * transaction statement before reporting command-complete. This is @@ -1693,7 +1693,7 @@ PostgresMain(int argc, char *argv[], const char *username) if (!IsUnderPostmaster) { puts("\nPOSTGRES backend interactive interface "); - puts("$Revision: 1.273 $ $Date: 2002/07/29 22:14:11 $\n"); + puts("$Revision: 1.274 $ $Date: 2002/07/30 05:13:06 $\n"); } /*