diff --git a/doc/src/sgml/libpq.sgml b/doc/src/sgml/libpq.sgml
index 3c9bc9cd2d7f026c1ccb7cf63ae534ad8d9e4542..43ec1a9bf6a34b4f47f26d71f6826b94a770a0b5 100644
--- a/doc/src/sgml/libpq.sgml
+++ b/doc/src/sgml/libpq.sgml
@@ -1,5 +1,5 @@
 <!--
-$Header: /cvsroot/pgsql/doc/src/sgml/libpq.sgml,v 1.114 2003/03/22 03:29:05 momjian Exp $
+$Header: /cvsroot/pgsql/doc/src/sgml/libpq.sgml,v 1.115 2003/03/24 18:33:52 momjian Exp $
 -->
 
  <chapter id="libpq">
@@ -857,11 +857,8 @@ returned by the server.
 maintain the <structname>PGresult</structname> abstraction.  Use the accessor functions below to get
 at the contents of <structname>PGresult</structname>.  Avoid directly referencing the fields of the
 <structname>PGresult</structname> structure because they are subject to change in the future.
-(Beginning in <productname>PostgreSQL</productname> 6.4, the
-definition of <type>struct</> behind <structname>PGresult</> is not even provided in <filename>libpq-fe.h</>.  If you
-have old code that accesses <structname>PGresult</structname> fields directly, you can keep using it
-by including <filename>libpq-int.h</filename> too, but you are encouraged to fix the code
-soon.)
+If <quote>autocommit</quote> is on, multiple queries sent in a single
+function call are processed in a single transaction.
 </para>
 
 <variablelist>
diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml
index f2cf072edc7fe605d6ec328daeb402bee55805a1..b00038fed51871c4265f5978e1d97fd3745ff2ce 100644
--- a/doc/src/sgml/ref/psql-ref.sgml
+++ b/doc/src/sgml/ref/psql-ref.sgml
@@ -1,5 +1,5 @@
 <!--
-$Header: /cvsroot/pgsql/doc/src/sgml/ref/psql-ref.sgml,v 1.86 2003/03/24 14:32:51 petere Exp $
+$Header: /cvsroot/pgsql/doc/src/sgml/ref/psql-ref.sgml,v 1.87 2003/03/24 18:33:52 momjian Exp $
 PostgreSQL documentation
 -->
 
@@ -86,6 +86,11 @@ PostgreSQL documentation
       meta-commands. To achieve that, you could pipe the string into
       <application>psql</application>, like this: <literal>echo "\x \\
       select * from foo;" | psql</literal>.
+      </para>
+      <para>
+      If <quote>autocommit</quote> is on, multiple queries in a single
+      string are processed in a single transaction.
+
       </para>
       </listitem>
     </varlistentry>
diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c
index 752a56a8e0f5eb613717e552b8cc160ee92606da..bbfa4695a3b534078f8db537e3ff0fedcbb0cf54 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");
 	}
 
 	/*