diff options
author | Bruce Momjian <bruce@momjian.us> | 2003-03-24 18:33:52 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2003-03-24 18:33:52 +0000 |
commit | 8670e3588f12c819b46e09963091b54fce79c8f5 (patch) | |
tree | fa70ec0c850168f5c0fa2bd5843a5ebd022d66c8 /src/backend/tcop/postgres.c | |
parent | d258ba01ec601f655137468bd484153eb369e92d (diff) | |
download | postgresql-8670e3588f12c819b46e09963091b54fce79c8f5.tar.gz postgresql-8670e3588f12c819b46e09963091b54fce79c8f5.zip |
Prevent multiple queries in a single string into a single transaction
when autocommit is off, and document grouping when autocommit is on.
Diffstat (limited to 'src/backend/tcop/postgres.c')
-rw-r--r-- | src/backend/tcop/postgres.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c index 752a56a8e0f..bbfa4695a3b 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.319 2003/03/22 04:23:34 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.320 2003/03/24 18:33:52 momjian Exp $ * * NOTES * this is the "main" module of the postgres backend and @@ -83,6 +83,8 @@ sigjmp_buf Warn_restart; bool Warn_restart_ready = false; bool InError = false; +extern bool autocommit; + static bool EchoQuery = false; /* default don't echo */ /* @@ -893,7 +895,7 @@ pg_exec_query_string(StringInfo query_string, /* string to execute */ * historical Postgres behavior, we do not force a transaction * boundary between queries appearing in a single query string. */ - if (lnext(parsetree_item) == NIL && xact_started) + if ((lnext(parsetree_item) == NIL || !autocommit) && xact_started) { finish_xact_command(false); xact_started = false; @@ -1793,7 +1795,7 @@ PostgresMain(int argc, char *argv[], const char *username) if (!IsUnderPostmaster) { puts("\nPOSTGRES backend interactive interface "); - puts("$Revision: 1.319 $ $Date: 2003/03/22 04:23:34 $\n"); + puts("$Revision: 1.320 $ $Date: 2003/03/24 18:33:52 $\n"); } /* |