aboutsummaryrefslogtreecommitdiff
path: root/src/backend/tcop/postgres.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2004-07-27 05:11:48 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2004-07-27 05:11:48 +0000
commitcc813fc2b8d9293bbd4d0e0d6a6f3b9cf02fe32f (patch)
tree9f7e6635c94bb61cb9d6340c3647c429dca9504b /src/backend/tcop/postgres.c
parentb1ee93884d528672fbce446a38659954a86219e1 (diff)
downloadpostgresql-cc813fc2b8d9293bbd4d0e0d6a6f3b9cf02fe32f.tar.gz
postgresql-cc813fc2b8d9293bbd4d0e0d6a6f3b9cf02fe32f.zip
Replace nested-BEGIN syntax for subtransactions with spec-compliant
SAVEPOINT/RELEASE/ROLLBACK-TO syntax. (Alvaro) Cause COMMIT of a failed transaction to report ROLLBACK instead of COMMIT in its command tag. (Tom) Fix a few loose ends in the nested-transactions stuff.
Diffstat (limited to 'src/backend/tcop/postgres.c')
-rw-r--r--src/backend/tcop/postgres.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c
index 36fb347de3e..a353122fc26 100644
--- a/src/backend/tcop/postgres.c
+++ b/src/backend/tcop/postgres.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/tcop/postgres.c,v 1.424 2004/07/17 03:29:00 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/tcop/postgres.c,v 1.425 2004/07/27 05:11:03 tgl Exp $
*
* NOTES
* this is the "main" module of the postgres backend and
@@ -841,8 +841,8 @@ exec_simple_query(const char *query_string)
TransactionStmt *stmt = (TransactionStmt *) parsetree;
if (stmt->kind == TRANS_STMT_COMMIT ||
- stmt->kind == TRANS_STMT_BEGIN ||
- stmt->kind == TRANS_STMT_ROLLBACK)
+ stmt->kind == TRANS_STMT_ROLLBACK ||
+ stmt->kind == TRANS_STMT_ROLLBACK_TO)
allowit = true;
}
@@ -1162,8 +1162,8 @@ exec_parse_message(const char *query_string, /* string to execute */
TransactionStmt *stmt = (TransactionStmt *) parsetree;
if (stmt->kind == TRANS_STMT_COMMIT ||
- stmt->kind == TRANS_STMT_BEGIN ||
- stmt->kind == TRANS_STMT_ROLLBACK)
+ stmt->kind == TRANS_STMT_ROLLBACK ||
+ stmt->kind == TRANS_STMT_ROLLBACK_TO)
allowit = true;
}
@@ -1625,8 +1625,8 @@ exec_execute_message(const char *portal_name, long max_rows)
is_trans_stmt = true;
if (stmt->kind == TRANS_STMT_COMMIT ||
- stmt->kind == TRANS_STMT_BEGIN ||
- stmt->kind == TRANS_STMT_ROLLBACK)
+ stmt->kind == TRANS_STMT_ROLLBACK ||
+ stmt->kind == TRANS_STMT_ROLLBACK_TO)
is_trans_exit = true;
}
}
@@ -2810,6 +2810,9 @@ PostgresMain(int argc, char *argv[], const char *username)
*/
MemoryContextSwitchTo(ErrorContext);
+ /* Make sure we are using a sane ResourceOwner, too */
+ CurrentResourceOwner = CurTransactionResourceOwner;
+
/* Do the recovery */
ereport(DEBUG2,
(errmsg_internal("AbortCurrentTransaction")));