aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2002-07-30 05:13:06 +0000
committerBruce Momjian <bruce@momjian.us>2002-07-30 05:13:06 +0000
commitb6440a7ece2cf729b27052c6cfd7e837a1eb74eb (patch)
treec45a05541dbecfc9e5f163b3e5950f72875985c8 /src
parenta89fc4e6de1eec6df3bbe1941b89ed7d3c690c72 (diff)
downloadpostgresql-b6440a7ece2cf729b27052c6cfd7e837a1eb74eb.tar.gz
postgresql-b6440a7ece2cf729b27052c6cfd7e837a1eb74eb.zip
Make statement_timeout apply to entire query string, not per statement.
Diffstat (limited to 'src')
-rw-r--r--src/backend/tcop/postgres.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c
index 8128487a2e5..53f6316d989 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");
}
/*