1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-08 11:42:09 +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:
Michael Paquier
2019-01-26 10:45:23 +09:00
parent df4c904440
commit c9b75c5838
7 changed files with 25 additions and 38 deletions

View File

@ -87,10 +87,10 @@ extern int synchronous_commit;
extern int MyXactFlags;
/*
* XACT_FLAGS_ACCESSEDTEMPREL - set when a temporary relation is accessed. We
* don't allow PREPARE TRANSACTION in that case.
* XACT_FLAGS_ACCESSEDTEMPNAMESPACE - set when a temporary object is accessed.
* We don't allow PREPARE TRANSACTION in that case.
*/
#define XACT_FLAGS_ACCESSEDTEMPREL (1U << 0)
#define XACT_FLAGS_ACCESSEDTEMPNAMESPACE (1U << 0)
/*
* XACT_FLAGS_ACQUIREDACCESSEXCLUSIVELOCK - records whether the top level xact
@ -98,12 +98,6 @@ extern int MyXactFlags;
*/
#define XACT_FLAGS_ACQUIREDACCESSEXCLUSIVELOCK (1U << 1)
/*
* XACT_FLAGS_ACCESSEDTEMPNAMESPACE - set when a temporary namespace is
* accessed. We don't allow PREPARE TRANSACTION in that case.
*/
#define XACT_FLAGS_ACCESSEDTEMPNAMESPACE (1U << 2)
/*
* start- and end-of-transaction callbacks for dynamically loaded modules
*/