1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-09 06:21:09 +03:00

Backend support for autocommit removed, per recent discussions. The

only remnant of this failed experiment is that the server will take
SET AUTOCOMMIT TO ON.  Still TODO: provide some client-side autocommit
logic in libpq.
This commit is contained in:
Tom Lane
2003-05-14 03:26:03 +00:00
parent d9b679c13a
commit f85f43dfb5
99 changed files with 277 additions and 536 deletions

View File

@@ -7,7 +7,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/async.c,v 1.93 2003/04/22 00:08:06 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/async.c,v 1.94 2003/05/14 03:26:01 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -399,9 +399,9 @@ Async_UnlistenOnExit(void)
*/
AbortOutOfAnyTransaction();
/* Now we can do the unlisten */
StartTransactionCommand(true);
StartTransactionCommand();
Async_UnlistenAll();
CommitTransactionCommand(true);
CommitTransactionCommand();
}
/*
@@ -769,7 +769,7 @@ ProcessIncomingNotify(void)
notifyInterruptOccurred = 0;
StartTransactionCommand(true);
StartTransactionCommand();
lRel = heap_openr(ListenerRelationName, AccessExclusiveLock);
tdesc = RelationGetDescr(lRel);
@@ -823,7 +823,7 @@ ProcessIncomingNotify(void)
*/
heap_close(lRel, NoLock);
CommitTransactionCommand(true);
CommitTransactionCommand();
/*
* Must flush the notify messages to ensure frontend gets them

View File

@@ -11,7 +11,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/cluster.c,v 1.108 2003/05/02 20:54:33 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/cluster.c,v 1.109 2003/05/14 03:26:01 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -205,7 +205,7 @@ cluster(ClusterStmt *stmt)
rvs = get_tables_to_cluster(cluster_context);
/* Commit to get out of starting transaction */
CommitTransactionCommand(true);
CommitTransactionCommand();
/* Ok, now that we've got them all, cluster them one by one */
foreach (rv, rvs)
@@ -213,14 +213,14 @@ cluster(ClusterStmt *stmt)
RelToCluster *rvtc = (RelToCluster *) lfirst(rv);
/* Start a new transaction for each relation. */
StartTransactionCommand(true);
StartTransactionCommand();
SetQuerySnapshot(); /* might be needed for functional index */
cluster_rel(rvtc, true);
CommitTransactionCommand(true);
CommitTransactionCommand();
}
/* Start a new transaction for the cleanup work. */
StartTransactionCommand(true);
StartTransactionCommand();
/* Clean up working storage */
MemoryContextDelete(cluster_context);

View File

@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/indexcmds.c,v 1.98 2003/05/02 20:54:33 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/indexcmds.c,v 1.99 2003/05/14 03:26:01 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -769,17 +769,16 @@ ReindexDatabase(const char *dbname, bool force, bool all)
heap_close(relationRelation, AccessShareLock);
/* Now reindex each rel in a separate transaction */
CommitTransactionCommand(true);
CommitTransactionCommand();
for (i = 0; i < relcnt; i++)
{
StartTransactionCommand(true);
StartTransactionCommand();
SetQuerySnapshot(); /* might be needed for functional index */
if (reindex_relation(relids[i], force))
elog(NOTICE, "relation %u was reindexed", relids[i]);
CommitTransactionCommand(true);
CommitTransactionCommand();
}
/* Tell xact.c not to chain the upcoming commit */
StartTransactionCommand(true);
StartTransactionCommand();
MemoryContextDelete(private_context);
}

View File

@@ -13,7 +13,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.252 2003/05/02 20:54:33 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.253 2003/05/14 03:26:01 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -275,7 +275,7 @@ vacuum(VacuumStmt *vacstmt)
}
/* matches the StartTransaction in PostgresMain() */
CommitTransactionCommand(true);
CommitTransactionCommand();
}
/*
@@ -303,7 +303,7 @@ vacuum(VacuumStmt *vacstmt)
*/
if (vacstmt->vacuum)
{
StartTransactionCommand(true);
StartTransactionCommand();
SetQuerySnapshot(); /* might be needed for functional index */
}
else
@@ -312,7 +312,7 @@ vacuum(VacuumStmt *vacstmt)
analyze_rel(relid, vacstmt);
if (vacstmt->vacuum)
CommitTransactionCommand(true);
CommitTransactionCommand();
else
{
MemoryContextSwitchTo(old_context);
@@ -330,11 +330,9 @@ vacuum(VacuumStmt *vacstmt)
/*
* This matches the CommitTransaction waiting for us in
* PostgresMain(). We tell xact.c not to chain the upcoming
* commit, so that a VACUUM doesn't start a transaction block,
* even when autocommit is off.
* PostgresMain().
*/
StartTransactionCommand(true);
StartTransactionCommand();
/*
* If it was a database-wide VACUUM, print FSM usage statistics
@@ -729,7 +727,7 @@ vacuum_rel(Oid relid, VacuumStmt *vacstmt, char expected_relkind)
bool result;
/* Begin a transaction for vacuuming this relation */
StartTransactionCommand(true);
StartTransactionCommand();
SetQuerySnapshot(); /* might be needed for functional index */
/*
@@ -746,7 +744,7 @@ vacuum_rel(Oid relid, VacuumStmt *vacstmt, char expected_relkind)
ObjectIdGetDatum(relid),
0, 0, 0))
{
CommitTransactionCommand(true);
CommitTransactionCommand();
return true; /* okay 'cause no data there */
}
@@ -778,7 +776,7 @@ vacuum_rel(Oid relid, VacuumStmt *vacstmt, char expected_relkind)
elog(WARNING, "Skipping \"%s\" --- only table or database owner can VACUUM it",
RelationGetRelationName(onerel));
relation_close(onerel, lmode);
CommitTransactionCommand(true);
CommitTransactionCommand();
return false;
}
@@ -791,7 +789,7 @@ vacuum_rel(Oid relid, VacuumStmt *vacstmt, char expected_relkind)
elog(WARNING, "Skipping \"%s\" --- can not process indexes, views or special system tables",
RelationGetRelationName(onerel));
relation_close(onerel, lmode);
CommitTransactionCommand(true);
CommitTransactionCommand();
return false;
}
@@ -805,7 +803,7 @@ vacuum_rel(Oid relid, VacuumStmt *vacstmt, char expected_relkind)
if (isOtherTempNamespace(RelationGetNamespace(onerel)))
{
relation_close(onerel, lmode);
CommitTransactionCommand(true);
CommitTransactionCommand();
return true; /* assume no long-lived data in temp tables */
}
@@ -843,7 +841,7 @@ vacuum_rel(Oid relid, VacuumStmt *vacstmt, char expected_relkind)
/*
* Complete the transaction and free all temporary memory used.
*/
CommitTransactionCommand(true);
CommitTransactionCommand();
/*
* If the relation has a secondary toast rel, vacuum that too while we