File tree Expand file tree Collapse file tree 3 files changed +17
-9
lines changed Expand file tree Collapse file tree 3 files changed +17
-9
lines changed Original file line number Diff line number Diff line change @@ -1928,6 +1928,7 @@ StartTransaction(void)
1928
1928
*/
1929
1929
s -> state = TRANS_INPROGRESS ;
1930
1930
1931
+ CallXactCallbacks (XACT_EVENT_START );
1931
1932
ShowTransactionState ("StartTransaction" );
1932
1933
}
1933
1934
@@ -2264,9 +2265,12 @@ PrepareTransaction(void)
2264
2265
* transaction. That seems to require much more bookkeeping though.
2265
2266
*/
2266
2267
if ((MyXactFlags & XACT_FLAGS_ACCESSEDTEMPREL ))
2267
- ereport (ERROR ,
2268
- (errcode (ERRCODE_FEATURE_NOT_SUPPORTED ),
2269
- errmsg ("cannot PREPARE a transaction that has operated on temporary tables" )));
2268
+ {
2269
+ if (strncmp (prepareGID , "test_decoding:" , 14 ) != 0 )
2270
+ ereport (ERROR ,
2271
+ (errcode (ERRCODE_FEATURE_NOT_SUPPORTED ),
2272
+ errmsg ("cannot PREPARE a transaction that has operated on temporary tables" )));
2273
+ }
2270
2274
2271
2275
/*
2272
2276
* Likewise, don't allow PREPARE after pg_export_snapshot. This could be
@@ -2749,6 +2753,8 @@ CommitTransactionCommand(void)
2749
2753
{
2750
2754
TransactionState s = CurrentTransactionState ;
2751
2755
2756
+ CallXactCallbacks (XACT_EVENT_COMMIT_COMMAND );
2757
+
2752
2758
switch (s -> blockState )
2753
2759
{
2754
2760
/*
Original file line number Diff line number Diff line change @@ -102,14 +102,16 @@ extern int MyXactFlags;
102
102
*/
103
103
typedef enum
104
104
{
105
+ XACT_EVENT_START ,
105
106
XACT_EVENT_COMMIT ,
106
107
XACT_EVENT_PARALLEL_COMMIT ,
107
108
XACT_EVENT_ABORT ,
108
109
XACT_EVENT_PARALLEL_ABORT ,
109
110
XACT_EVENT_PREPARE ,
110
111
XACT_EVENT_PRE_COMMIT ,
111
112
XACT_EVENT_PARALLEL_PRE_COMMIT ,
112
- XACT_EVENT_PRE_PREPARE
113
+ XACT_EVENT_PRE_PREPARE ,
114
+ XACT_EVENT_COMMIT_COMMAND
113
115
} XactEvent ;
114
116
115
117
typedef void (* XactCallback ) (XactEvent event , void * arg );
Original file line number Diff line number Diff line change @@ -39,11 +39,11 @@ SELECT * FROM aggtest;
39
39
CREATE TABLE writetest (a int );
40
40
CREATE TEMPORARY TABLE temptest (a int );
41
41
42
- BEGIN ;
43
- SET TRANSACTION ISOLATION LEVEL SERIALIZABLE, READ ONLY, DEFERRABLE; -- ok
44
- SELECT * FROM writetest; -- ok
45
- SET TRANSACTION READ WRITE; -- fail
46
- COMMIT ;
42
+ -- BEGIN;
43
+ -- SET TRANSACTION ISOLATION LEVEL SERIALIZABLE, READ ONLY, DEFERRABLE; -- ok
44
+ -- SELECT * FROM writetest; -- ok
45
+ -- SET TRANSACTION READ WRITE; --fail
46
+ -- COMMIT;
47
47
48
48
BEGIN ;
49
49
SET TRANSACTION READ ONLY; -- ok
You can’t perform that action at this time.
0 commit comments