mirror of
https://github.com/postgres/postgres.git
synced 2025-09-03 15:22:11 +03:00
Simplify restriction handling of two-phase commit for temporary objects
There were two flags used to track the access to temporary tables and to the temporary namespace of a session which are used to restrict PREPARE TRANSACTION, however the first control flag is a concept included in the second. This removes the flag for temporary table tracking, keeping around only the one at namespace level. Author: Michael Paquier Reviewed-by: Álvaro Herrera Discussion: https://postgr.es/m/20190118053126.GH1883@paquier.xyz
This commit is contained in:
@@ -108,7 +108,7 @@ RangeVarCallbackForLockTable(const RangeVar *rv, Oid relid, Oid oldrelid,
|
||||
*/
|
||||
relpersistence = get_rel_persistence(relid);
|
||||
if (relpersistence == RELPERSISTENCE_TEMP)
|
||||
MyXactFlags |= XACT_FLAGS_ACCESSEDTEMPREL;
|
||||
MyXactFlags |= XACT_FLAGS_ACCESSEDTEMPNAMESPACE;
|
||||
|
||||
/* Check permissions. */
|
||||
aclresult = LockTableAclCheck(relid, lockmode, GetUserId());
|
||||
|
@@ -13642,7 +13642,7 @@ PreCommit_on_commit_actions(void)
|
||||
* relations, we can skip truncating ON COMMIT DELETE ROWS
|
||||
* tables, as they must still be empty.
|
||||
*/
|
||||
if ((MyXactFlags & XACT_FLAGS_ACCESSEDTEMPREL))
|
||||
if ((MyXactFlags & XACT_FLAGS_ACCESSEDTEMPNAMESPACE))
|
||||
oids_to_truncate = lappend_oid(oids_to_truncate, oc->relid);
|
||||
break;
|
||||
case ONCOMMIT_DROP:
|
||||
|
Reference in New Issue
Block a user