mirror of
https://github.com/postgres/postgres.git
synced 2025-06-30 21:42:05 +03:00
Rename TransactionChain functions
We call this thing a "transaction block" everywhere except in a few functions, where it is mysteriously called a "transaction chain". In the SQL standard, a transaction chain is something different. So rename these functions to match the common terminology. Reviewed-by: Alvaro Herrera <alvherre@alvh.no-ip.org>
This commit is contained in:
@ -202,7 +202,7 @@ cluster(ClusterStmt *stmt, bool isTopLevel)
|
||||
* We cannot run this form of CLUSTER inside a user transaction block;
|
||||
* we'd be holding locks way too long.
|
||||
*/
|
||||
PreventTransactionChain(isTopLevel, "CLUSTER");
|
||||
PreventInTransactionBlock(isTopLevel, "CLUSTER");
|
||||
|
||||
/*
|
||||
* Create special memory context for cross-transaction storage.
|
||||
|
@ -1476,7 +1476,7 @@ AlterDatabase(ParseState *pstate, AlterDatabaseStmt *stmt, bool isTopLevel)
|
||||
dtablespace->defname),
|
||||
parser_errposition(pstate, dtablespace->location)));
|
||||
/* this case isn't allowed within a transaction block */
|
||||
PreventTransactionChain(isTopLevel, "ALTER DATABASE SET TABLESPACE");
|
||||
PreventInTransactionBlock(isTopLevel, "ALTER DATABASE SET TABLESPACE");
|
||||
movedb(stmt->dbname, defGetString(dtablespace));
|
||||
return InvalidOid;
|
||||
}
|
||||
|
@ -63,7 +63,7 @@ DiscardAll(bool isTopLevel)
|
||||
* DISCARD ALL inside a transaction block would leave the transaction
|
||||
* still uncommitted.
|
||||
*/
|
||||
PreventTransactionChain(isTopLevel, "DISCARD ALL");
|
||||
PreventInTransactionBlock(isTopLevel, "DISCARD ALL");
|
||||
|
||||
/* Closing portals might run user-defined code, so do that first. */
|
||||
PortalHashTableDeleteAll();
|
||||
|
@ -63,7 +63,7 @@ PerformCursorOpen(DeclareCursorStmt *cstmt, ParamListInfo params,
|
||||
* user-visible effect).
|
||||
*/
|
||||
if (!(cstmt->options & CURSOR_OPT_HOLD))
|
||||
RequireTransactionChain(isTopLevel, "DECLARE CURSOR");
|
||||
RequireTransactionBlock(isTopLevel, "DECLARE CURSOR");
|
||||
|
||||
/*
|
||||
* Parse analysis was done already, but we still have to run the rule
|
||||
|
@ -339,7 +339,7 @@ CreateSubscription(CreateSubscriptionStmt *stmt, bool isTopLevel)
|
||||
* replication slot.
|
||||
*/
|
||||
if (create_slot)
|
||||
PreventTransactionChain(isTopLevel, "CREATE SUBSCRIPTION ... WITH (create_slot = true)");
|
||||
PreventInTransactionBlock(isTopLevel, "CREATE SUBSCRIPTION ... WITH (create_slot = true)");
|
||||
|
||||
if (!superuser())
|
||||
ereport(ERROR,
|
||||
@ -897,7 +897,7 @@ DropSubscription(DropSubscriptionStmt *stmt, bool isTopLevel)
|
||||
* don't have the proper facilities for that.
|
||||
*/
|
||||
if (slotname)
|
||||
PreventTransactionChain(isTopLevel, "DROP SUBSCRIPTION");
|
||||
PreventInTransactionBlock(isTopLevel, "DROP SUBSCRIPTION");
|
||||
|
||||
|
||||
ObjectAddressSet(myself, SubscriptionRelationId, subid);
|
||||
|
@ -1321,7 +1321,7 @@ AlterEnum(AlterEnumStmt *stmt, bool isTopLevel)
|
||||
!(tup->t_data->t_infomask & HEAP_UPDATED))
|
||||
/* safe to do inside transaction block */ ;
|
||||
else
|
||||
PreventTransactionChain(isTopLevel, "ALTER TYPE ... ADD");
|
||||
PreventInTransactionBlock(isTopLevel, "ALTER TYPE ... ADD");
|
||||
|
||||
AddEnumLabel(enum_type_oid, stmt->newVal,
|
||||
stmt->newValNeighbor, stmt->newValIsAfter,
|
||||
|
@ -186,11 +186,11 @@ vacuum(int options, List *relations, VacuumParams *params,
|
||||
*/
|
||||
if (options & VACOPT_VACUUM)
|
||||
{
|
||||
PreventTransactionChain(isTopLevel, stmttype);
|
||||
PreventInTransactionBlock(isTopLevel, stmttype);
|
||||
in_outer_xact = false;
|
||||
}
|
||||
else
|
||||
in_outer_xact = IsInTransactionChain(isTopLevel);
|
||||
in_outer_xact = IsInTransactionBlock(isTopLevel);
|
||||
|
||||
/*
|
||||
* Due to static variables vac_context, anl_context and vac_strategy,
|
||||
|
Reference in New Issue
Block a user