62
62
#include "pglogical_output/hooks.h"
63
63
#include "parser/analyze.h"
64
64
#include "parser/parse_relation.h"
65
+ #include "parser/parse_type.h"
66
+ #include "catalog/pg_class.h"
67
+ #include "catalog/pg_type.h"
65
68
#include "tcop/pquery.h"
66
69
#include "lib/ilist.h"
67
70
@@ -3915,7 +3918,6 @@ static void MtmProcessUtility(Node *parsetree, const char *queryString,
3915
3918
case T_DoStmt :
3916
3919
case T_CreateTableSpaceStmt :
3917
3920
case T_AlterTableSpaceOptionsStmt :
3918
- case T_TruncateStmt :
3919
3921
case T_CommentStmt :
3920
3922
case T_PrepareStmt :
3921
3923
case T_ExecuteStmt :
@@ -3934,6 +3936,43 @@ static void MtmProcessUtility(Node *parsetree, const char *queryString,
3934
3936
skipCommand = true;
3935
3937
break ;
3936
3938
3939
+ case T_CreateDomainStmt :
3940
+ {
3941
+ CreateDomainStmt * stmt = (CreateDomainStmt * ) parsetree ;
3942
+ HeapTuple typeTup ;
3943
+ Form_pg_type baseType ;
3944
+ Form_pg_type elementType ;
3945
+ Form_pg_class pgClassStruct ;
3946
+ int32 basetypeMod ;
3947
+ Oid elementTypeOid ;
3948
+ Oid tableOid ;
3949
+ HeapTuple pgClassTuple ;
3950
+ HeapTuple elementTypeTuple ;
3951
+
3952
+ typeTup = typenameType (NULL , stmt -> typeName , & basetypeMod );
3953
+ baseType = (Form_pg_type ) GETSTRUCT (typeTup );
3954
+ elementTypeOid = baseType -> typelem ;
3955
+ ReleaseSysCache (typeTup );
3956
+
3957
+ if (elementTypeOid == InvalidOid )
3958
+ break ;
3959
+
3960
+ elementTypeTuple = SearchSysCache1 (TYPEOID , elementTypeOid );
3961
+ elementType = (Form_pg_type ) GETSTRUCT (elementTypeTuple );
3962
+ tableOid = elementType -> typrelid ;
3963
+ ReleaseSysCache (elementTypeTuple );
3964
+
3965
+ if (tableOid == InvalidOid )
3966
+ break ;
3967
+
3968
+ pgClassTuple = SearchSysCache1 (RELOID , tableOid );
3969
+ pgClassStruct = (Form_pg_class ) GETSTRUCT (pgClassTuple );
3970
+ if (pgClassStruct -> relpersistence == 't' )
3971
+ MyXactAccessedTempRel = true;
3972
+ ReleaseSysCache (pgClassTuple );
3973
+ }
3974
+ break ;
3975
+
3937
3976
case T_ExplainStmt :
3938
3977
/*
3939
3978
* EXPLAIN ANALYZE can create side-effects.
0 commit comments