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
@@ -3916,7 +3919,6 @@ static void MtmProcessUtility(Node *parsetree, const char *queryString,
3916
3919
case T_DoStmt :
3917
3920
case T_CreateTableSpaceStmt :
3918
3921
case T_AlterTableSpaceOptionsStmt :
3919
- case T_TruncateStmt :
3920
3922
case T_CommentStmt :
3921
3923
case T_PrepareStmt :
3922
3924
case T_ExecuteStmt :
@@ -3935,6 +3937,43 @@ static void MtmProcessUtility(Node *parsetree, const char *queryString,
3935
3937
skipCommand = true;
3936
3938
break ;
3937
3939
3940
+ case T_CreateDomainStmt :
3941
+ {
3942
+ CreateDomainStmt * stmt = (CreateDomainStmt * ) parsetree ;
3943
+ HeapTuple typeTup ;
3944
+ Form_pg_type baseType ;
3945
+ Form_pg_type elementType ;
3946
+ Form_pg_class pgClassStruct ;
3947
+ int32 basetypeMod ;
3948
+ Oid elementTypeOid ;
3949
+ Oid tableOid ;
3950
+ HeapTuple pgClassTuple ;
3951
+ HeapTuple elementTypeTuple ;
3952
+
3953
+ typeTup = typenameType (NULL , stmt -> typeName , & basetypeMod );
3954
+ baseType = (Form_pg_type ) GETSTRUCT (typeTup );
3955
+ elementTypeOid = baseType -> typelem ;
3956
+ ReleaseSysCache (typeTup );
3957
+
3958
+ if (elementTypeOid == InvalidOid )
3959
+ break ;
3960
+
3961
+ elementTypeTuple = SearchSysCache1 (TYPEOID , elementTypeOid );
3962
+ elementType = (Form_pg_type ) GETSTRUCT (elementTypeTuple );
3963
+ tableOid = elementType -> typrelid ;
3964
+ ReleaseSysCache (elementTypeTuple );
3965
+
3966
+ if (tableOid == InvalidOid )
3967
+ break ;
3968
+
3969
+ pgClassTuple = SearchSysCache1 (RELOID , tableOid );
3970
+ pgClassStruct = (Form_pg_class ) GETSTRUCT (pgClassTuple );
3971
+ if (pgClassStruct -> relpersistence == 't' )
3972
+ MyXactAccessedTempRel = true;
3973
+ ReleaseSysCache (pgClassTuple );
3974
+ }
3975
+ break ;
3976
+
3938
3977
case T_ExplainStmt :
3939
3978
/*
3940
3979
* EXPLAIN ANALYZE can create side-effects.
0 commit comments