*** ./src/backend/access/transam/xact.c.orig Thu Aug 22 18:08:44 2002 --- ./src/backend/access/transam/xact.c Thu Aug 22 18:16:15 2002 *************** *** 227,232 **** --- 227,233 ---- static void (*_RollbackFunc) (void *) = NULL; static void *_RollbackData = NULL; + bool autocommit = true; /* ---------------------------------------------------------------- * transaction state accessors *************** *** 1162,1171 **** * if we aren't in a transaction block, we just do our usual * start transaction. */ ! case TBLOCK_DEFAULT: ! StartTransaction(); ! break; ! /* * We should never experience this -- if we do it means the * BEGIN state was not changed in the previous --- 1163,1177 ---- * if we aren't in a transaction block, we just do our usual * start transaction. */ ! case TBLOCK_DEFAULT: ! StartTransaction(); ! if (! autocommit) { /* if we're in no-autocommit mode, start a new transaction */ ! /* elog(NOTICE, "Automatically beginning a new transaction block."); */ ! BeginTransactionBlock(); ! CommitTransactionCommand(); ! } ! break; ! /* * We should never experience this -- if we do it means the * BEGIN state was not changed in the previous *************** *** 1198,1203 **** --- 1204,1214 ---- s->blockState = TBLOCK_DEFAULT; CommitTransaction(); StartTransaction(); + if (! autocommit) { /* if we're in no-autocommit mode, start a new transaction */ + /* elog(NOTICE, "Automatically beginning a new transaction block."); */ + BeginTransactionBlock(); + CommitTransactionCommand(); + } break; /* *** ./src/backend/utils/misc/guc.c.orig Thu Aug 22 18:08:44 2002 --- ./src/backend/utils/misc/guc.c Thu Aug 22 17:53:29 2002 *************** *** 22,27 **** --- 22,28 ---- #include "utils/guc.h" #include "access/xlog.h" + #include "access/xact.h" #include "catalog/namespace.h" #include "catalog/pg_type.h" #include "commands/async.h" *************** *** 487,493 **** { "db_user_namespace", PGC_SIGHUP }, &Db_user_namespace, false, NULL, NULL }, ! { { NULL, 0 }, NULL, false, NULL, NULL } --- 488,497 ---- { "db_user_namespace", PGC_SIGHUP }, &Db_user_namespace, false, NULL, NULL }, ! { ! { "autocommit", PGC_USERSET }, &autocommit, ! true, NULL, NULL ! }, { { NULL, 0 }, NULL, false, NULL, NULL } *** ./src/backend/utils/misc/postgresql.conf.sample.orig Thu Aug 22 18:08:44 2002 --- ./src/backend/utils/misc/postgresql.conf.sample Thu Aug 22 17:53:41 2002 *************** *** 201,203 **** --- 201,204 ---- #transform_null_equals = false #statement_timeout = 0 # 0 is disabled #db_user_namespace = false + #autocommit = true *** ./src/bin/psql/tab-complete.c.orig Thu Aug 22 18:08:44 2002 --- ./src/bin/psql/tab-complete.c Thu Aug 22 17:53:09 2002 *************** *** 270,275 **** --- 270,277 ---- "search_path", "statement_timeout", + "autocommit", + NULL }; *** ./src/include/access/xact.h.orig Thu Aug 22 18:08:44 2002 --- ./src/include/access/xact.h Thu Aug 22 17:52:59 2002 *************** *** 129,132 **** --- 129,139 ---- extern Datum xideq(PG_FUNCTION_ARGS); extern Datum xid_age(PG_FUNCTION_ARGS); + /* ------------ + * GUC global for autocommit mode + * ------------ + */ + + extern bool autocommit; + #endif /* XACT_H */