introduces operation type for dist ops

pull/6088/head
aykutbozkurt 2022-08-01 13:39:14 +03:00
parent 57ce4cf8c4
commit c98a68662a
6 changed files with 302 additions and 6 deletions

View File

@ -23,6 +23,7 @@ static DistributeObjectOps NoDistributeOps = {
.qualify = NULL, .qualify = NULL,
.preprocess = NULL, .preprocess = NULL,
.postprocess = NULL, .postprocess = NULL,
.operationType = DIST_OPS_NONE,
.address = NULL, .address = NULL,
.markDistributed = false, .markDistributed = false,
}; };
@ -32,6 +33,7 @@ static DistributeObjectOps Aggregate_AlterObjectSchema = {
.preprocess = PreprocessAlterDistributedObjectStmt, .preprocess = PreprocessAlterDistributedObjectStmt,
.postprocess = PostprocessAlterDistributedObjectStmt, .postprocess = PostprocessAlterDistributedObjectStmt,
.objectType = OBJECT_FUNCTION, .objectType = OBJECT_FUNCTION,
.operationType = DIST_OPS_ALTER,
.address = AlterFunctionSchemaStmtObjectAddress, .address = AlterFunctionSchemaStmtObjectAddress,
.markDistributed = false, .markDistributed = false,
}; };
@ -41,6 +43,7 @@ static DistributeObjectOps Aggregate_AlterOwner = {
.preprocess = PreprocessAlterDistributedObjectStmt, .preprocess = PreprocessAlterDistributedObjectStmt,
.postprocess = PostprocessAlterDistributedObjectStmt, .postprocess = PostprocessAlterDistributedObjectStmt,
.objectType = OBJECT_FUNCTION, .objectType = OBJECT_FUNCTION,
.operationType = DIST_OPS_ALTER,
.address = AlterFunctionOwnerObjectAddress, .address = AlterFunctionOwnerObjectAddress,
.markDistributed = false, .markDistributed = false,
}; };
@ -50,6 +53,7 @@ static DistributeObjectOps Aggregate_Define = {
.preprocess = NULL, .preprocess = NULL,
.postprocess = PostprocessCreateDistributedObjectFromCatalogStmt, .postprocess = PostprocessCreateDistributedObjectFromCatalogStmt,
.objectType = OBJECT_AGGREGATE, .objectType = OBJECT_AGGREGATE,
.operationType = DIST_OPS_CREATE,
.address = DefineAggregateStmtObjectAddress, .address = DefineAggregateStmtObjectAddress,
.markDistributed = true, .markDistributed = true,
}; };
@ -58,6 +62,7 @@ static DistributeObjectOps Aggregate_Drop = {
.qualify = NULL, .qualify = NULL,
.preprocess = PreprocessDropDistributedObjectStmt, .preprocess = PreprocessDropDistributedObjectStmt,
.postprocess = NULL, .postprocess = NULL,
.operationType = DIST_OPS_DROP,
.address = NULL, .address = NULL,
.markDistributed = false, .markDistributed = false,
}; };
@ -67,6 +72,7 @@ static DistributeObjectOps Aggregate_Rename = {
.preprocess = PreprocessAlterDistributedObjectStmt, .preprocess = PreprocessAlterDistributedObjectStmt,
.postprocess = NULL, .postprocess = NULL,
.objectType = OBJECT_FUNCTION, .objectType = OBJECT_FUNCTION,
.operationType = DIST_OPS_ALTER,
.address = RenameFunctionStmtObjectAddress, .address = RenameFunctionStmtObjectAddress,
.markDistributed = false, .markDistributed = false,
}; };
@ -76,6 +82,7 @@ static DistributeObjectOps Any_AlterEnum = {
.preprocess = PreprocessAlterDistributedObjectStmt, .preprocess = PreprocessAlterDistributedObjectStmt,
.postprocess = NULL, .postprocess = NULL,
.objectType = OBJECT_TYPE, .objectType = OBJECT_TYPE,
.operationType = DIST_OPS_ALTER,
.address = AlterEnumStmtObjectAddress, .address = AlterEnumStmtObjectAddress,
.markDistributed = false, .markDistributed = false,
}; };
@ -84,6 +91,7 @@ static DistributeObjectOps Any_AlterExtension = {
.qualify = NULL, .qualify = NULL,
.preprocess = PreprocessAlterExtensionUpdateStmt, .preprocess = PreprocessAlterExtensionUpdateStmt,
.postprocess = NULL, .postprocess = NULL,
.operationType = DIST_OPS_ALTER,
.address = AlterExtensionUpdateStmtObjectAddress, .address = AlterExtensionUpdateStmtObjectAddress,
.markDistributed = false, .markDistributed = false,
}; };
@ -92,6 +100,7 @@ static DistributeObjectOps Any_AlterExtensionContents = {
.qualify = NULL, .qualify = NULL,
.preprocess = PreprocessAlterExtensionContentsStmt, .preprocess = PreprocessAlterExtensionContentsStmt,
.postprocess = NULL, .postprocess = NULL,
.operationType = DIST_OPS_ALTER,
.address = NULL, .address = NULL,
.markDistributed = false, .markDistributed = false,
}; };
@ -101,6 +110,7 @@ static DistributeObjectOps Any_AlterForeignServer = {
.preprocess = PreprocessAlterDistributedObjectStmt, .preprocess = PreprocessAlterDistributedObjectStmt,
.postprocess = NULL, .postprocess = NULL,
.objectType = OBJECT_FOREIGN_SERVER, .objectType = OBJECT_FOREIGN_SERVER,
.operationType = DIST_OPS_ALTER,
.address = AlterForeignServerStmtObjectAddress, .address = AlterForeignServerStmtObjectAddress,
.markDistributed = false, .markDistributed = false,
}; };
@ -109,6 +119,7 @@ static DistributeObjectOps Any_AlterFunction = {
.qualify = QualifyAlterFunctionStmt, .qualify = QualifyAlterFunctionStmt,
.preprocess = PreprocessAlterFunctionStmt, .preprocess = PreprocessAlterFunctionStmt,
.postprocess = NULL, .postprocess = NULL,
.operationType = DIST_OPS_ALTER,
.address = AlterFunctionStmtObjectAddress, .address = AlterFunctionStmtObjectAddress,
.markDistributed = false, .markDistributed = false,
}; };
@ -117,6 +128,7 @@ static DistributeObjectOps Any_AlterPolicy = {
.qualify = NULL, .qualify = NULL,
.preprocess = PreprocessAlterPolicyStmt, .preprocess = PreprocessAlterPolicyStmt,
.postprocess = NULL, .postprocess = NULL,
.operationType = DIST_OPS_ALTER,
.address = NULL, .address = NULL,
.markDistributed = false, .markDistributed = false,
}; };
@ -125,6 +137,7 @@ static DistributeObjectOps Any_AlterRole = {
.qualify = NULL, .qualify = NULL,
.preprocess = NULL, .preprocess = NULL,
.postprocess = PostprocessAlterRoleStmt, .postprocess = PostprocessAlterRoleStmt,
.operationType = DIST_OPS_ALTER,
.address = AlterRoleStmtObjectAddress, .address = AlterRoleStmtObjectAddress,
.markDistributed = false, .markDistributed = false,
}; };
@ -133,6 +146,7 @@ static DistributeObjectOps Any_AlterRoleSet = {
.qualify = QualifyAlterRoleSetStmt, .qualify = QualifyAlterRoleSetStmt,
.preprocess = PreprocessAlterRoleSetStmt, .preprocess = PreprocessAlterRoleSetStmt,
.postprocess = NULL, .postprocess = NULL,
.operationType = DIST_OPS_ALTER,
.address = AlterRoleSetStmtObjectAddress, .address = AlterRoleSetStmtObjectAddress,
.markDistributed = false, .markDistributed = false,
}; };
@ -141,6 +155,7 @@ static DistributeObjectOps Any_AlterTableMoveAll = {
.qualify = NULL, .qualify = NULL,
.preprocess = PreprocessAlterTableMoveAllStmt, .preprocess = PreprocessAlterTableMoveAllStmt,
.postprocess = NULL, .postprocess = NULL,
.operationType = DIST_OPS_ALTER,
.address = NULL, .address = NULL,
.markDistributed = false, .markDistributed = false,
}; };
@ -149,6 +164,7 @@ static DistributeObjectOps Any_Cluster = {
.qualify = NULL, .qualify = NULL,
.preprocess = PreprocessClusterStmt, .preprocess = PreprocessClusterStmt,
.postprocess = NULL, .postprocess = NULL,
.operationType = DIST_OPS_NONE,
.address = NULL, .address = NULL,
.markDistributed = false, .markDistributed = false,
}; };
@ -158,6 +174,7 @@ static DistributeObjectOps Any_CompositeType = {
.preprocess = NULL, .preprocess = NULL,
.postprocess = PostprocessCreateDistributedObjectFromCatalogStmt, .postprocess = PostprocessCreateDistributedObjectFromCatalogStmt,
.objectType = OBJECT_TYPE, .objectType = OBJECT_TYPE,
.operationType = DIST_OPS_CREATE,
.featureFlag = &EnableCreateTypePropagation, .featureFlag = &EnableCreateTypePropagation,
.address = CompositeTypeStmtObjectAddress, .address = CompositeTypeStmtObjectAddress,
.markDistributed = true, .markDistributed = true,
@ -168,6 +185,7 @@ static DistributeObjectOps Any_CreateDomain = {
.preprocess = NULL, .preprocess = NULL,
.postprocess = PostprocessCreateDistributedObjectFromCatalogStmt, .postprocess = PostprocessCreateDistributedObjectFromCatalogStmt,
.objectType = OBJECT_DOMAIN, .objectType = OBJECT_DOMAIN,
.operationType = DIST_OPS_CREATE,
.address = CreateDomainStmtObjectAddress, .address = CreateDomainStmtObjectAddress,
.markDistributed = true, .markDistributed = true,
}; };
@ -177,6 +195,7 @@ static DistributeObjectOps Any_CreateEnum = {
.preprocess = NULL, .preprocess = NULL,
.postprocess = PostprocessCreateDistributedObjectFromCatalogStmt, .postprocess = PostprocessCreateDistributedObjectFromCatalogStmt,
.objectType = OBJECT_TYPE, .objectType = OBJECT_TYPE,
.operationType = DIST_OPS_CREATE,
.featureFlag = &EnableCreateTypePropagation, .featureFlag = &EnableCreateTypePropagation,
.address = CreateEnumStmtObjectAddress, .address = CreateEnumStmtObjectAddress,
.markDistributed = true, .markDistributed = true,
@ -186,6 +205,7 @@ static DistributeObjectOps Any_CreateExtension = {
.qualify = NULL, .qualify = NULL,
.preprocess = NULL, .preprocess = NULL,
.postprocess = PostprocessCreateExtensionStmt, .postprocess = PostprocessCreateExtensionStmt,
.operationType = DIST_OPS_CREATE,
.address = CreateExtensionStmtObjectAddress, .address = CreateExtensionStmtObjectAddress,
.markDistributed = true, .markDistributed = true,
}; };
@ -194,6 +214,7 @@ static DistributeObjectOps Any_CreateFunction = {
.qualify = NULL, .qualify = NULL,
.preprocess = PreprocessCreateFunctionStmt, .preprocess = PreprocessCreateFunctionStmt,
.postprocess = PostprocessCreateFunctionStmt, .postprocess = PostprocessCreateFunctionStmt,
.operationType = DIST_OPS_CREATE,
.address = CreateFunctionStmtObjectAddress, .address = CreateFunctionStmtObjectAddress,
.markDistributed = true, .markDistributed = true,
}; };
@ -202,6 +223,7 @@ static DistributeObjectOps Any_View = {
.qualify = NULL, .qualify = NULL,
.preprocess = PreprocessViewStmt, .preprocess = PreprocessViewStmt,
.postprocess = PostprocessViewStmt, .postprocess = PostprocessViewStmt,
.operationType = DIST_OPS_CREATE,
.address = ViewStmtObjectAddress, .address = ViewStmtObjectAddress,
.markDistributed = true, .markDistributed = true,
}; };
@ -210,6 +232,7 @@ static DistributeObjectOps Any_CreatePolicy = {
.qualify = NULL, .qualify = NULL,
.preprocess = NULL, .preprocess = NULL,
.postprocess = PostprocessCreatePolicyStmt, .postprocess = PostprocessCreatePolicyStmt,
.operationType = DIST_OPS_CREATE,
.address = NULL, .address = NULL,
.markDistributed = false, .markDistributed = false,
}; };
@ -218,6 +241,7 @@ static DistributeObjectOps Any_CreateRole = {
.qualify = NULL, .qualify = NULL,
.preprocess = PreprocessCreateRoleStmt, .preprocess = PreprocessCreateRoleStmt,
.postprocess = NULL, .postprocess = NULL,
.operationType = DIST_OPS_CREATE,
.address = CreateRoleStmtObjectAddress, .address = CreateRoleStmtObjectAddress,
.markDistributed = true, .markDistributed = true,
}; };
@ -226,6 +250,7 @@ static DistributeObjectOps Any_DropRole = {
.qualify = NULL, .qualify = NULL,
.preprocess = PreprocessDropRoleStmt, .preprocess = PreprocessDropRoleStmt,
.postprocess = NULL, .postprocess = NULL,
.operationType = DIST_OPS_DROP,
.address = NULL, .address = NULL,
.markDistributed = false, .markDistributed = false,
}; };
@ -235,6 +260,7 @@ static DistributeObjectOps Any_CreateForeignServer = {
.preprocess = NULL, .preprocess = NULL,
.postprocess = PostprocessCreateDistributedObjectFromCatalogStmt, .postprocess = PostprocessCreateDistributedObjectFromCatalogStmt,
.objectType = OBJECT_FOREIGN_SERVER, .objectType = OBJECT_FOREIGN_SERVER,
.operationType = DIST_OPS_CREATE,
.address = CreateForeignServerStmtObjectAddress, .address = CreateForeignServerStmtObjectAddress,
.markDistributed = true, .markDistributed = true,
}; };
@ -243,6 +269,7 @@ static DistributeObjectOps Any_CreateSchema = {
.qualify = NULL, .qualify = NULL,
.preprocess = PreprocessCreateSchemaStmt, .preprocess = PreprocessCreateSchemaStmt,
.postprocess = NULL, .postprocess = NULL,
.operationType = DIST_OPS_CREATE,
.address = CreateSchemaStmtObjectAddress, .address = CreateSchemaStmtObjectAddress,
.markDistributed = true, .markDistributed = true,
}; };
@ -251,6 +278,7 @@ static DistributeObjectOps Any_CreateStatistics = {
.qualify = QualifyCreateStatisticsStmt, .qualify = QualifyCreateStatisticsStmt,
.preprocess = PreprocessCreateStatisticsStmt, .preprocess = PreprocessCreateStatisticsStmt,
.postprocess = PostprocessCreateStatisticsStmt, .postprocess = PostprocessCreateStatisticsStmt,
.operationType = DIST_OPS_CREATE,
.address = CreateStatisticsStmtObjectAddress, .address = CreateStatisticsStmtObjectAddress,
.markDistributed = false, .markDistributed = false,
}; };
@ -259,6 +287,7 @@ static DistributeObjectOps Any_CreateTrigger = {
.qualify = NULL, .qualify = NULL,
.preprocess = NULL, .preprocess = NULL,
.postprocess = PostprocessCreateTriggerStmt, .postprocess = PostprocessCreateTriggerStmt,
.operationType = DIST_OPS_CREATE,
.address = CreateTriggerStmtObjectAddress, .address = CreateTriggerStmtObjectAddress,
.markDistributed = false, .markDistributed = false,
}; };
@ -267,6 +296,7 @@ static DistributeObjectOps Any_Grant = {
.qualify = NULL, .qualify = NULL,
.preprocess = PreprocessGrantStmt, .preprocess = PreprocessGrantStmt,
.postprocess = NULL, .postprocess = NULL,
.operationType = DIST_OPS_ALTER,
.address = NULL, .address = NULL,
.markDistributed = false, .markDistributed = false,
}; };
@ -275,6 +305,7 @@ static DistributeObjectOps Any_GrantRole = {
.qualify = NULL, .qualify = NULL,
.preprocess = PreprocessGrantRoleStmt, .preprocess = PreprocessGrantRoleStmt,
.postprocess = PostprocessGrantRoleStmt, .postprocess = PostprocessGrantRoleStmt,
.operationType = DIST_OPS_ALTER,
.address = NULL, .address = NULL,
.markDistributed = false, .markDistributed = false,
}; };
@ -283,6 +314,7 @@ static DistributeObjectOps Any_Index = {
.qualify = NULL, .qualify = NULL,
.preprocess = PreprocessIndexStmt, .preprocess = PreprocessIndexStmt,
.postprocess = PostprocessIndexStmt, .postprocess = PostprocessIndexStmt,
.operationType = DIST_OPS_CREATE,
.address = NULL, .address = NULL,
.markDistributed = false, .markDistributed = false,
}; };
@ -291,6 +323,7 @@ static DistributeObjectOps Any_Reindex = {
.qualify = NULL, .qualify = NULL,
.preprocess = PreprocessReindexStmt, .preprocess = PreprocessReindexStmt,
.postprocess = NULL, .postprocess = NULL,
.operationType = DIST_OPS_NONE,
.address = ReindexStmtObjectAddress, .address = ReindexStmtObjectAddress,
.markDistributed = false, .markDistributed = false,
}; };
@ -299,6 +332,7 @@ static DistributeObjectOps Any_Rename = {
.qualify = NULL, .qualify = NULL,
.preprocess = PreprocessRenameStmt, .preprocess = PreprocessRenameStmt,
.postprocess = NULL, .postprocess = NULL,
.operationType = DIST_OPS_ALTER,
.address = NULL, .address = NULL,
.markDistributed = false, .markDistributed = false,
}; };
@ -307,6 +341,7 @@ static DistributeObjectOps Attribute_Rename = {
.qualify = QualifyRenameAttributeStmt, .qualify = QualifyRenameAttributeStmt,
.preprocess = PreprocessRenameAttributeStmt, .preprocess = PreprocessRenameAttributeStmt,
.postprocess = NULL, .postprocess = NULL,
.operationType = DIST_OPS_ALTER,
.address = RenameAttributeStmtObjectAddress, .address = RenameAttributeStmtObjectAddress,
.markDistributed = false, .markDistributed = false,
}; };
@ -316,6 +351,7 @@ static DistributeObjectOps Collation_AlterObjectSchema = {
.preprocess = PreprocessAlterDistributedObjectStmt, .preprocess = PreprocessAlterDistributedObjectStmt,
.postprocess = PostprocessAlterDistributedObjectStmt, .postprocess = PostprocessAlterDistributedObjectStmt,
.objectType = OBJECT_COLLATION, .objectType = OBJECT_COLLATION,
.operationType = DIST_OPS_ALTER,
.address = AlterCollationSchemaStmtObjectAddress, .address = AlterCollationSchemaStmtObjectAddress,
.markDistributed = false, .markDistributed = false,
}; };
@ -325,6 +361,7 @@ static DistributeObjectOps Collation_AlterOwner = {
.preprocess = PreprocessAlterDistributedObjectStmt, .preprocess = PreprocessAlterDistributedObjectStmt,
.postprocess = PostprocessAlterDistributedObjectStmt, .postprocess = PostprocessAlterDistributedObjectStmt,
.objectType = OBJECT_COLLATION, .objectType = OBJECT_COLLATION,
.operationType = DIST_OPS_ALTER,
.address = AlterCollationOwnerObjectAddress, .address = AlterCollationOwnerObjectAddress,
.markDistributed = false, .markDistributed = false,
}; };
@ -334,6 +371,7 @@ static DistributeObjectOps Collation_Define = {
.preprocess = NULL, .preprocess = NULL,
.postprocess = PostprocessCreateDistributedObjectFromCatalogStmt, .postprocess = PostprocessCreateDistributedObjectFromCatalogStmt,
.objectType = OBJECT_COLLATION, .objectType = OBJECT_COLLATION,
.operationType = DIST_OPS_CREATE,
.address = DefineCollationStmtObjectAddress, .address = DefineCollationStmtObjectAddress,
.markDistributed = true, .markDistributed = true,
}; };
@ -342,6 +380,7 @@ static DistributeObjectOps Collation_Drop = {
.qualify = QualifyDropCollationStmt, .qualify = QualifyDropCollationStmt,
.preprocess = PreprocessDropDistributedObjectStmt, .preprocess = PreprocessDropDistributedObjectStmt,
.postprocess = NULL, .postprocess = NULL,
.operationType = DIST_OPS_DROP,
.address = NULL, .address = NULL,
.markDistributed = false, .markDistributed = false,
}; };
@ -351,6 +390,7 @@ static DistributeObjectOps Collation_Rename = {
.preprocess = PreprocessAlterDistributedObjectStmt, .preprocess = PreprocessAlterDistributedObjectStmt,
.postprocess = NULL, .postprocess = NULL,
.objectType = OBJECT_COLLATION, .objectType = OBJECT_COLLATION,
.operationType = DIST_OPS_ALTER,
.address = RenameCollationStmtObjectAddress, .address = RenameCollationStmtObjectAddress,
.markDistributed = false, .markDistributed = false,
}; };
@ -360,6 +400,7 @@ static DistributeObjectOps Database_AlterOwner = {
.preprocess = PreprocessAlterDistributedObjectStmt, .preprocess = PreprocessAlterDistributedObjectStmt,
.postprocess = PostprocessAlterDistributedObjectStmt, .postprocess = PostprocessAlterDistributedObjectStmt,
.objectType = OBJECT_DATABASE, .objectType = OBJECT_DATABASE,
.operationType = DIST_OPS_ALTER,
.featureFlag = &EnableAlterDatabaseOwner, .featureFlag = &EnableAlterDatabaseOwner,
.address = AlterDatabaseOwnerObjectAddress, .address = AlterDatabaseOwnerObjectAddress,
.markDistributed = false, .markDistributed = false,
@ -370,6 +411,7 @@ static DistributeObjectOps Domain_Alter = {
.preprocess = PreprocessAlterDistributedObjectStmt, .preprocess = PreprocessAlterDistributedObjectStmt,
.postprocess = PostprocessAlterDistributedObjectStmt, .postprocess = PostprocessAlterDistributedObjectStmt,
.objectType = OBJECT_DOMAIN, .objectType = OBJECT_DOMAIN,
.operationType = DIST_OPS_ALTER,
.address = AlterDomainStmtObjectAddress, .address = AlterDomainStmtObjectAddress,
.markDistributed = false, .markDistributed = false,
}; };
@ -379,6 +421,7 @@ static DistributeObjectOps Domain_AlterObjectSchema = {
.preprocess = PreprocessAlterDistributedObjectStmt, .preprocess = PreprocessAlterDistributedObjectStmt,
.postprocess = PostprocessAlterDistributedObjectStmt, .postprocess = PostprocessAlterDistributedObjectStmt,
.objectType = OBJECT_DOMAIN, .objectType = OBJECT_DOMAIN,
.operationType = DIST_OPS_ALTER,
.address = AlterTypeSchemaStmtObjectAddress, .address = AlterTypeSchemaStmtObjectAddress,
.markDistributed = false, .markDistributed = false,
}; };
@ -388,6 +431,7 @@ static DistributeObjectOps Domain_AlterOwner = {
.preprocess = PreprocessAlterDistributedObjectStmt, .preprocess = PreprocessAlterDistributedObjectStmt,
.postprocess = PostprocessAlterDistributedObjectStmt, .postprocess = PostprocessAlterDistributedObjectStmt,
.objectType = OBJECT_DOMAIN, .objectType = OBJECT_DOMAIN,
.operationType = DIST_OPS_ALTER,
.address = AlterDomainOwnerStmtObjectAddress, .address = AlterDomainOwnerStmtObjectAddress,
.markDistributed = false, .markDistributed = false,
}; };
@ -396,6 +440,7 @@ static DistributeObjectOps Domain_Drop = {
.qualify = QualifyDropDomainStmt, .qualify = QualifyDropDomainStmt,
.preprocess = PreprocessDropDistributedObjectStmt, .preprocess = PreprocessDropDistributedObjectStmt,
.postprocess = NULL, .postprocess = NULL,
.operationType = DIST_OPS_DROP,
.address = NULL, .address = NULL,
.markDistributed = false, .markDistributed = false,
}; };
@ -405,6 +450,7 @@ static DistributeObjectOps Domain_Rename = {
.preprocess = PreprocessAlterDistributedObjectStmt, .preprocess = PreprocessAlterDistributedObjectStmt,
.postprocess = NULL, .postprocess = NULL,
.objectType = OBJECT_DOMAIN, .objectType = OBJECT_DOMAIN,
.operationType = DIST_OPS_ALTER,
.address = RenameDomainStmtObjectAddress, .address = RenameDomainStmtObjectAddress,
.markDistributed = false, .markDistributed = false,
}; };
@ -415,6 +461,7 @@ static DistributeObjectOps Domain_RenameConstraint = {
.preprocess = PreprocessAlterDistributedObjectStmt, .preprocess = PreprocessAlterDistributedObjectStmt,
.postprocess = NULL, .postprocess = NULL,
.objectType = OBJECT_DOMAIN, .objectType = OBJECT_DOMAIN,
.operationType = DIST_OPS_ALTER,
.address = DomainRenameConstraintStmtObjectAddress, .address = DomainRenameConstraintStmtObjectAddress,
.markDistributed = false, .markDistributed = false,
}; };
@ -423,6 +470,7 @@ static DistributeObjectOps Extension_AlterObjectSchema = {
.qualify = NULL, .qualify = NULL,
.preprocess = PreprocessAlterExtensionSchemaStmt, .preprocess = PreprocessAlterExtensionSchemaStmt,
.postprocess = PostprocessAlterExtensionSchemaStmt, .postprocess = PostprocessAlterExtensionSchemaStmt,
.operationType = DIST_OPS_ALTER,
.address = AlterExtensionSchemaStmtObjectAddress, .address = AlterExtensionSchemaStmtObjectAddress,
.markDistributed = false, .markDistributed = false,
}; };
@ -431,6 +479,7 @@ static DistributeObjectOps Extension_Drop = {
.qualify = NULL, .qualify = NULL,
.preprocess = PreprocessDropExtensionStmt, .preprocess = PreprocessDropExtensionStmt,
.postprocess = NULL, .postprocess = NULL,
.operationType = DIST_OPS_DROP,
.address = NULL, .address = NULL,
.markDistributed = false, .markDistributed = false,
}; };
@ -439,6 +488,7 @@ static DistributeObjectOps FDW_Grant = {
.qualify = NULL, .qualify = NULL,
.preprocess = PreprocessGrantOnFDWStmt, .preprocess = PreprocessGrantOnFDWStmt,
.postprocess = NULL, .postprocess = NULL,
.operationType = DIST_OPS_ALTER,
.address = NULL, .address = NULL,
.markDistributed = false, .markDistributed = false,
}; };
@ -447,6 +497,7 @@ static DistributeObjectOps ForeignServer_Drop = {
.qualify = NULL, .qualify = NULL,
.preprocess = PreprocessDropDistributedObjectStmt, .preprocess = PreprocessDropDistributedObjectStmt,
.postprocess = NULL, .postprocess = NULL,
.operationType = DIST_OPS_DROP,
.address = NULL, .address = NULL,
.markDistributed = false, .markDistributed = false,
}; };
@ -455,6 +506,7 @@ static DistributeObjectOps ForeignServer_Grant = {
.qualify = NULL, .qualify = NULL,
.preprocess = PreprocessGrantOnForeignServerStmt, .preprocess = PreprocessGrantOnForeignServerStmt,
.postprocess = NULL, .postprocess = NULL,
.operationType = DIST_OPS_ALTER,
.address = NULL, .address = NULL,
.markDistributed = false, .markDistributed = false,
}; };
@ -464,6 +516,7 @@ static DistributeObjectOps ForeignServer_Rename = {
.preprocess = PreprocessAlterDistributedObjectStmt, .preprocess = PreprocessAlterDistributedObjectStmt,
.postprocess = NULL, .postprocess = NULL,
.objectType = OBJECT_FOREIGN_SERVER, .objectType = OBJECT_FOREIGN_SERVER,
.operationType = DIST_OPS_ALTER,
.address = RenameForeignServerStmtObjectAddress, .address = RenameForeignServerStmtObjectAddress,
.markDistributed = false, .markDistributed = false,
}; };
@ -473,6 +526,7 @@ static DistributeObjectOps ForeignServer_AlterOwner = {
.preprocess = PreprocessAlterDistributedObjectStmt, .preprocess = PreprocessAlterDistributedObjectStmt,
.postprocess = PostprocessAlterDistributedObjectStmt, .postprocess = PostprocessAlterDistributedObjectStmt,
.objectType = OBJECT_FOREIGN_SERVER, .objectType = OBJECT_FOREIGN_SERVER,
.operationType = DIST_OPS_ALTER,
.address = AlterForeignServerOwnerStmtObjectAddress, .address = AlterForeignServerOwnerStmtObjectAddress,
.markDistributed = false, .markDistributed = false,
}; };
@ -481,6 +535,7 @@ static DistributeObjectOps ForeignTable_AlterTable = {
.qualify = NULL, .qualify = NULL,
.preprocess = PreprocessAlterTableStmt, .preprocess = PreprocessAlterTableStmt,
.postprocess = NULL, .postprocess = NULL,
.operationType = DIST_OPS_ALTER,
.address = NULL, .address = NULL,
.markDistributed = false, .markDistributed = false,
}; };
@ -489,6 +544,7 @@ static DistributeObjectOps Function_AlterObjectDepends = {
.qualify = QualifyAlterFunctionDependsStmt, .qualify = QualifyAlterFunctionDependsStmt,
.preprocess = PreprocessAlterFunctionDependsStmt, .preprocess = PreprocessAlterFunctionDependsStmt,
.postprocess = NULL, .postprocess = NULL,
.operationType = DIST_OPS_ALTER,
.address = AlterFunctionDependsStmtObjectAddress, .address = AlterFunctionDependsStmtObjectAddress,
.markDistributed = false, .markDistributed = false,
}; };
@ -498,6 +554,7 @@ static DistributeObjectOps Function_AlterObjectSchema = {
.preprocess = PreprocessAlterDistributedObjectStmt, .preprocess = PreprocessAlterDistributedObjectStmt,
.postprocess = PostprocessAlterDistributedObjectStmt, .postprocess = PostprocessAlterDistributedObjectStmt,
.objectType = OBJECT_FUNCTION, .objectType = OBJECT_FUNCTION,
.operationType = DIST_OPS_ALTER,
.address = AlterFunctionSchemaStmtObjectAddress, .address = AlterFunctionSchemaStmtObjectAddress,
.markDistributed = false, .markDistributed = false,
}; };
@ -507,6 +564,7 @@ static DistributeObjectOps Function_AlterOwner = {
.preprocess = PreprocessAlterDistributedObjectStmt, .preprocess = PreprocessAlterDistributedObjectStmt,
.postprocess = PostprocessAlterDistributedObjectStmt, .postprocess = PostprocessAlterDistributedObjectStmt,
.objectType = OBJECT_FUNCTION, .objectType = OBJECT_FUNCTION,
.operationType = DIST_OPS_ALTER,
.address = AlterFunctionOwnerObjectAddress, .address = AlterFunctionOwnerObjectAddress,
.markDistributed = false, .markDistributed = false,
}; };
@ -515,6 +573,7 @@ static DistributeObjectOps Function_Drop = {
.qualify = NULL, .qualify = NULL,
.preprocess = PreprocessDropDistributedObjectStmt, .preprocess = PreprocessDropDistributedObjectStmt,
.postprocess = NULL, .postprocess = NULL,
.operationType = DIST_OPS_DROP,
.address = NULL, .address = NULL,
.markDistributed = false, .markDistributed = false,
}; };
@ -523,6 +582,7 @@ static DistributeObjectOps Function_Grant = {
.qualify = NULL, .qualify = NULL,
.preprocess = PreprocessGrantOnFunctionStmt, .preprocess = PreprocessGrantOnFunctionStmt,
.postprocess = PostprocessGrantOnFunctionStmt, .postprocess = PostprocessGrantOnFunctionStmt,
.operationType = DIST_OPS_ALTER,
.address = NULL, .address = NULL,
.markDistributed = false, .markDistributed = false,
}; };
@ -531,6 +591,7 @@ static DistributeObjectOps View_Drop = {
.qualify = QualifyDropViewStmt, .qualify = QualifyDropViewStmt,
.preprocess = PreprocessDropViewStmt, .preprocess = PreprocessDropViewStmt,
.postprocess = NULL, .postprocess = NULL,
.operationType = DIST_OPS_DROP,
.address = DropViewStmtObjectAddress, .address = DropViewStmtObjectAddress,
.markDistributed = false, .markDistributed = false,
}; };
@ -540,6 +601,7 @@ static DistributeObjectOps Function_Rename = {
.preprocess = PreprocessAlterDistributedObjectStmt, .preprocess = PreprocessAlterDistributedObjectStmt,
.postprocess = NULL, .postprocess = NULL,
.objectType = OBJECT_FUNCTION, .objectType = OBJECT_FUNCTION,
.operationType = DIST_OPS_ALTER,
.address = RenameFunctionStmtObjectAddress, .address = RenameFunctionStmtObjectAddress,
.markDistributed = false, .markDistributed = false,
}; };
@ -548,6 +610,7 @@ static DistributeObjectOps Index_AlterTable = {
.qualify = NULL, .qualify = NULL,
.preprocess = PreprocessAlterTableStmt, .preprocess = PreprocessAlterTableStmt,
.postprocess = NULL, .postprocess = NULL,
.operationType = DIST_OPS_ALTER,
.address = NULL, .address = NULL,
.markDistributed = false, .markDistributed = false,
}; };
@ -556,6 +619,7 @@ static DistributeObjectOps Index_Drop = {
.qualify = NULL, .qualify = NULL,
.preprocess = PreprocessDropIndexStmt, .preprocess = PreprocessDropIndexStmt,
.postprocess = NULL, .postprocess = NULL,
.operationType = DIST_OPS_DROP,
.address = NULL, .address = NULL,
.markDistributed = false, .markDistributed = false,
}; };
@ -564,6 +628,7 @@ static DistributeObjectOps Policy_Drop = {
.qualify = NULL, .qualify = NULL,
.preprocess = PreprocessDropPolicyStmt, .preprocess = PreprocessDropPolicyStmt,
.postprocess = NULL, .postprocess = NULL,
.operationType = DIST_OPS_DROP,
.address = NULL, .address = NULL,
.markDistributed = false, .markDistributed = false,
}; };
@ -572,6 +637,7 @@ static DistributeObjectOps Procedure_AlterObjectDepends = {
.qualify = QualifyAlterFunctionDependsStmt, .qualify = QualifyAlterFunctionDependsStmt,
.preprocess = PreprocessAlterFunctionDependsStmt, .preprocess = PreprocessAlterFunctionDependsStmt,
.postprocess = NULL, .postprocess = NULL,
.operationType = DIST_OPS_ALTER,
.address = AlterFunctionDependsStmtObjectAddress, .address = AlterFunctionDependsStmtObjectAddress,
.markDistributed = false, .markDistributed = false,
}; };
@ -581,6 +647,7 @@ static DistributeObjectOps Procedure_AlterObjectSchema = {
.preprocess = PreprocessAlterDistributedObjectStmt, .preprocess = PreprocessAlterDistributedObjectStmt,
.postprocess = PostprocessAlterDistributedObjectStmt, .postprocess = PostprocessAlterDistributedObjectStmt,
.objectType = OBJECT_FUNCTION, .objectType = OBJECT_FUNCTION,
.operationType = DIST_OPS_ALTER,
.address = AlterFunctionSchemaStmtObjectAddress, .address = AlterFunctionSchemaStmtObjectAddress,
.markDistributed = false, .markDistributed = false,
}; };
@ -590,6 +657,7 @@ static DistributeObjectOps Procedure_AlterOwner = {
.preprocess = PreprocessAlterDistributedObjectStmt, .preprocess = PreprocessAlterDistributedObjectStmt,
.postprocess = PostprocessAlterDistributedObjectStmt, .postprocess = PostprocessAlterDistributedObjectStmt,
.objectType = OBJECT_FUNCTION, .objectType = OBJECT_FUNCTION,
.operationType = DIST_OPS_ALTER,
.address = AlterFunctionOwnerObjectAddress, .address = AlterFunctionOwnerObjectAddress,
.markDistributed = false, .markDistributed = false,
}; };
@ -598,6 +666,7 @@ static DistributeObjectOps Procedure_Drop = {
.qualify = NULL, .qualify = NULL,
.preprocess = PreprocessDropDistributedObjectStmt, .preprocess = PreprocessDropDistributedObjectStmt,
.postprocess = NULL, .postprocess = NULL,
.operationType = DIST_OPS_DROP,
.address = NULL, .address = NULL,
.markDistributed = false, .markDistributed = false,
}; };
@ -606,6 +675,7 @@ static DistributeObjectOps Procedure_Grant = {
.qualify = NULL, .qualify = NULL,
.preprocess = PreprocessGrantOnFunctionStmt, .preprocess = PreprocessGrantOnFunctionStmt,
.postprocess = PostprocessGrantOnFunctionStmt, .postprocess = PostprocessGrantOnFunctionStmt,
.operationType = DIST_OPS_ALTER,
.address = NULL, .address = NULL,
.markDistributed = false, .markDistributed = false,
}; };
@ -615,6 +685,7 @@ static DistributeObjectOps Procedure_Rename = {
.preprocess = PreprocessAlterDistributedObjectStmt, .preprocess = PreprocessAlterDistributedObjectStmt,
.postprocess = NULL, .postprocess = NULL,
.objectType = OBJECT_FUNCTION, .objectType = OBJECT_FUNCTION,
.operationType = DIST_OPS_ALTER,
.address = RenameFunctionStmtObjectAddress, .address = RenameFunctionStmtObjectAddress,
.markDistributed = false, .markDistributed = false,
}; };
@ -623,6 +694,7 @@ static DistributeObjectOps Routine_AlterObjectDepends = {
.qualify = QualifyAlterFunctionDependsStmt, .qualify = QualifyAlterFunctionDependsStmt,
.preprocess = PreprocessAlterFunctionDependsStmt, .preprocess = PreprocessAlterFunctionDependsStmt,
.postprocess = NULL, .postprocess = NULL,
.operationType = DIST_OPS_ALTER,
.address = AlterFunctionDependsStmtObjectAddress, .address = AlterFunctionDependsStmtObjectAddress,
.markDistributed = false, .markDistributed = false,
}; };
@ -631,6 +703,7 @@ static DistributeObjectOps Sequence_Alter = {
.qualify = NULL, .qualify = NULL,
.preprocess = PreprocessAlterSequenceStmt, .preprocess = PreprocessAlterSequenceStmt,
.postprocess = NULL, .postprocess = NULL,
.operationType = DIST_OPS_ALTER,
.address = AlterSequenceStmtObjectAddress, .address = AlterSequenceStmtObjectAddress,
.markDistributed = false, .markDistributed = false,
}; };
@ -639,6 +712,7 @@ static DistributeObjectOps Sequence_AlterObjectSchema = {
.qualify = QualifyAlterSequenceSchemaStmt, .qualify = QualifyAlterSequenceSchemaStmt,
.preprocess = PreprocessAlterSequenceSchemaStmt, .preprocess = PreprocessAlterSequenceSchemaStmt,
.postprocess = PostprocessAlterSequenceSchemaStmt, .postprocess = PostprocessAlterSequenceSchemaStmt,
.operationType = DIST_OPS_ALTER,
.address = AlterSequenceSchemaStmtObjectAddress, .address = AlterSequenceSchemaStmtObjectAddress,
.markDistributed = false, .markDistributed = false,
}; };
@ -647,6 +721,7 @@ static DistributeObjectOps Sequence_AlterOwner = {
.qualify = QualifyAlterSequenceOwnerStmt, .qualify = QualifyAlterSequenceOwnerStmt,
.preprocess = PreprocessAlterSequenceOwnerStmt, .preprocess = PreprocessAlterSequenceOwnerStmt,
.postprocess = PostprocessAlterSequenceOwnerStmt, .postprocess = PostprocessAlterSequenceOwnerStmt,
.operationType = DIST_OPS_ALTER,
.address = AlterSequenceOwnerStmtObjectAddress, .address = AlterSequenceOwnerStmtObjectAddress,
.markDistributed = false, .markDistributed = false,
}; };
@ -655,6 +730,7 @@ static DistributeObjectOps Sequence_Drop = {
.qualify = QualifyDropSequenceStmt, .qualify = QualifyDropSequenceStmt,
.preprocess = PreprocessDropSequenceStmt, .preprocess = PreprocessDropSequenceStmt,
.postprocess = NULL, .postprocess = NULL,
.operationType = DIST_OPS_DROP,
.address = SequenceDropStmtObjectAddress, .address = SequenceDropStmtObjectAddress,
.markDistributed = false, .markDistributed = false,
}; };
@ -663,6 +739,7 @@ static DistributeObjectOps Sequence_Grant = {
.qualify = QualifyGrantOnSequenceStmt, .qualify = QualifyGrantOnSequenceStmt,
.preprocess = PreprocessGrantOnSequenceStmt, .preprocess = PreprocessGrantOnSequenceStmt,
.postprocess = PostprocessGrantOnSequenceStmt, .postprocess = PostprocessGrantOnSequenceStmt,
.operationType = DIST_OPS_ALTER,
.address = NULL, .address = NULL,
.markDistributed = false, .markDistributed = false,
}; };
@ -671,6 +748,7 @@ static DistributeObjectOps Sequence_Rename = {
.qualify = QualifyRenameSequenceStmt, .qualify = QualifyRenameSequenceStmt,
.preprocess = PreprocessRenameSequenceStmt, .preprocess = PreprocessRenameSequenceStmt,
.postprocess = NULL, .postprocess = NULL,
.operationType = DIST_OPS_ALTER,
.address = RenameSequenceStmtObjectAddress, .address = RenameSequenceStmtObjectAddress,
.markDistributed = false, .markDistributed = false,
}; };
@ -680,6 +758,7 @@ static DistributeObjectOps TextSearchConfig_Alter = {
.preprocess = PreprocessAlterDistributedObjectStmt, .preprocess = PreprocessAlterDistributedObjectStmt,
.postprocess = NULL, .postprocess = NULL,
.objectType = OBJECT_TSCONFIGURATION, .objectType = OBJECT_TSCONFIGURATION,
.operationType = DIST_OPS_ALTER,
.address = AlterTextSearchConfigurationStmtObjectAddress, .address = AlterTextSearchConfigurationStmtObjectAddress,
.markDistributed = false, .markDistributed = false,
}; };
@ -689,6 +768,7 @@ static DistributeObjectOps TextSearchConfig_AlterObjectSchema = {
.preprocess = PreprocessAlterDistributedObjectStmt, .preprocess = PreprocessAlterDistributedObjectStmt,
.postprocess = PostprocessAlterDistributedObjectStmt, .postprocess = PostprocessAlterDistributedObjectStmt,
.objectType = OBJECT_TSCONFIGURATION, .objectType = OBJECT_TSCONFIGURATION,
.operationType = DIST_OPS_ALTER,
.address = AlterTextSearchConfigurationSchemaStmtObjectAddress, .address = AlterTextSearchConfigurationSchemaStmtObjectAddress,
.markDistributed = false, .markDistributed = false,
}; };
@ -698,6 +778,7 @@ static DistributeObjectOps TextSearchConfig_AlterOwner = {
.preprocess = PreprocessAlterDistributedObjectStmt, .preprocess = PreprocessAlterDistributedObjectStmt,
.postprocess = PostprocessAlterDistributedObjectStmt, .postprocess = PostprocessAlterDistributedObjectStmt,
.objectType = OBJECT_TSCONFIGURATION, .objectType = OBJECT_TSCONFIGURATION,
.operationType = DIST_OPS_ALTER,
.address = AlterTextSearchConfigurationOwnerObjectAddress, .address = AlterTextSearchConfigurationOwnerObjectAddress,
.markDistributed = false, .markDistributed = false,
}; };
@ -707,6 +788,7 @@ static DistributeObjectOps TextSearchConfig_Comment = {
.preprocess = PreprocessAlterDistributedObjectStmt, .preprocess = PreprocessAlterDistributedObjectStmt,
.postprocess = NULL, .postprocess = NULL,
.objectType = OBJECT_TSCONFIGURATION, .objectType = OBJECT_TSCONFIGURATION,
.operationType = DIST_OPS_ALTER,
.address = TextSearchConfigurationCommentObjectAddress, .address = TextSearchConfigurationCommentObjectAddress,
.markDistributed = false, .markDistributed = false,
}; };
@ -716,6 +798,7 @@ static DistributeObjectOps TextSearchConfig_Define = {
.preprocess = NULL, .preprocess = NULL,
.postprocess = PostprocessCreateDistributedObjectFromCatalogStmt, .postprocess = PostprocessCreateDistributedObjectFromCatalogStmt,
.objectType = OBJECT_TSCONFIGURATION, .objectType = OBJECT_TSCONFIGURATION,
.operationType = DIST_OPS_CREATE,
.address = CreateTextSearchConfigurationObjectAddress, .address = CreateTextSearchConfigurationObjectAddress,
.markDistributed = true, .markDistributed = true,
}; };
@ -724,6 +807,7 @@ static DistributeObjectOps TextSearchConfig_Drop = {
.qualify = QualifyDropTextSearchConfigurationStmt, .qualify = QualifyDropTextSearchConfigurationStmt,
.preprocess = PreprocessDropDistributedObjectStmt, .preprocess = PreprocessDropDistributedObjectStmt,
.postprocess = NULL, .postprocess = NULL,
.operationType = DIST_OPS_DROP,
.address = DropTextSearchConfigObjectAddress, .address = DropTextSearchConfigObjectAddress,
.markDistributed = false, .markDistributed = false,
}; };
@ -733,6 +817,7 @@ static DistributeObjectOps TextSearchConfig_Rename = {
.preprocess = PreprocessAlterDistributedObjectStmt, .preprocess = PreprocessAlterDistributedObjectStmt,
.postprocess = NULL, .postprocess = NULL,
.objectType = OBJECT_TSCONFIGURATION, .objectType = OBJECT_TSCONFIGURATION,
.operationType = DIST_OPS_ALTER,
.address = RenameTextSearchConfigurationStmtObjectAddress, .address = RenameTextSearchConfigurationStmtObjectAddress,
.markDistributed = false, .markDistributed = false,
}; };
@ -742,6 +827,7 @@ static DistributeObjectOps TextSearchDict_Alter = {
.preprocess = PreprocessAlterDistributedObjectStmt, .preprocess = PreprocessAlterDistributedObjectStmt,
.postprocess = NULL, .postprocess = NULL,
.objectType = OBJECT_TSDICTIONARY, .objectType = OBJECT_TSDICTIONARY,
.operationType = DIST_OPS_ALTER,
.address = AlterTextSearchDictionaryStmtObjectAddress, .address = AlterTextSearchDictionaryStmtObjectAddress,
.markDistributed = false, .markDistributed = false,
}; };
@ -751,6 +837,7 @@ static DistributeObjectOps TextSearchDict_AlterObjectSchema = {
.preprocess = PreprocessAlterDistributedObjectStmt, .preprocess = PreprocessAlterDistributedObjectStmt,
.postprocess = PostprocessAlterDistributedObjectStmt, .postprocess = PostprocessAlterDistributedObjectStmt,
.objectType = OBJECT_TSDICTIONARY, .objectType = OBJECT_TSDICTIONARY,
.operationType = DIST_OPS_ALTER,
.address = AlterTextSearchDictionarySchemaStmtObjectAddress, .address = AlterTextSearchDictionarySchemaStmtObjectAddress,
.markDistributed = false, .markDistributed = false,
}; };
@ -760,6 +847,7 @@ static DistributeObjectOps TextSearchDict_AlterOwner = {
.preprocess = PreprocessAlterDistributedObjectStmt, .preprocess = PreprocessAlterDistributedObjectStmt,
.postprocess = PostprocessAlterDistributedObjectStmt, .postprocess = PostprocessAlterDistributedObjectStmt,
.objectType = OBJECT_TSDICTIONARY, .objectType = OBJECT_TSDICTIONARY,
.operationType = DIST_OPS_ALTER,
.address = AlterTextSearchDictOwnerObjectAddress, .address = AlterTextSearchDictOwnerObjectAddress,
.markDistributed = false, .markDistributed = false,
}; };
@ -769,6 +857,7 @@ static DistributeObjectOps TextSearchDict_Comment = {
.preprocess = PreprocessAlterDistributedObjectStmt, .preprocess = PreprocessAlterDistributedObjectStmt,
.postprocess = NULL, .postprocess = NULL,
.objectType = OBJECT_TSDICTIONARY, .objectType = OBJECT_TSDICTIONARY,
.operationType = DIST_OPS_ALTER,
.address = TextSearchDictCommentObjectAddress, .address = TextSearchDictCommentObjectAddress,
.markDistributed = false, .markDistributed = false,
}; };
@ -778,6 +867,7 @@ static DistributeObjectOps TextSearchDict_Define = {
.preprocess = NULL, .preprocess = NULL,
.postprocess = PostprocessCreateDistributedObjectFromCatalogStmt, .postprocess = PostprocessCreateDistributedObjectFromCatalogStmt,
.objectType = OBJECT_TSDICTIONARY, .objectType = OBJECT_TSDICTIONARY,
.operationType = DIST_OPS_CREATE,
.address = CreateTextSearchDictObjectAddress, .address = CreateTextSearchDictObjectAddress,
.markDistributed = true, .markDistributed = true,
}; };
@ -786,6 +876,7 @@ static DistributeObjectOps TextSearchDict_Drop = {
.qualify = QualifyDropTextSearchDictionaryStmt, .qualify = QualifyDropTextSearchDictionaryStmt,
.preprocess = PreprocessDropDistributedObjectStmt, .preprocess = PreprocessDropDistributedObjectStmt,
.postprocess = NULL, .postprocess = NULL,
.operationType = DIST_OPS_DROP,
.address = DropTextSearchDictObjectAddress, .address = DropTextSearchDictObjectAddress,
.markDistributed = false, .markDistributed = false,
}; };
@ -795,6 +886,7 @@ static DistributeObjectOps TextSearchDict_Rename = {
.preprocess = PreprocessAlterDistributedObjectStmt, .preprocess = PreprocessAlterDistributedObjectStmt,
.postprocess = NULL, .postprocess = NULL,
.objectType = OBJECT_TSDICTIONARY, .objectType = OBJECT_TSDICTIONARY,
.operationType = DIST_OPS_ALTER,
.address = RenameTextSearchDictionaryStmtObjectAddress, .address = RenameTextSearchDictionaryStmtObjectAddress,
.markDistributed = false, .markDistributed = false,
}; };
@ -803,6 +895,7 @@ static DistributeObjectOps Trigger_AlterObjectDepends = {
.qualify = NULL, .qualify = NULL,
.preprocess = PreprocessAlterTriggerDependsStmt, .preprocess = PreprocessAlterTriggerDependsStmt,
.postprocess = PostprocessAlterTriggerDependsStmt, .postprocess = PostprocessAlterTriggerDependsStmt,
.operationType = DIST_OPS_ALTER,
.address = NULL, .address = NULL,
.markDistributed = false, .markDistributed = false,
}; };
@ -812,6 +905,7 @@ static DistributeObjectOps Routine_AlterObjectSchema = {
.preprocess = PreprocessAlterDistributedObjectStmt, .preprocess = PreprocessAlterDistributedObjectStmt,
.postprocess = PostprocessAlterDistributedObjectStmt, .postprocess = PostprocessAlterDistributedObjectStmt,
.objectType = OBJECT_FUNCTION, .objectType = OBJECT_FUNCTION,
.operationType = DIST_OPS_ALTER,
.address = AlterFunctionSchemaStmtObjectAddress, .address = AlterFunctionSchemaStmtObjectAddress,
.markDistributed = false, .markDistributed = false,
}; };
@ -821,6 +915,7 @@ static DistributeObjectOps Routine_AlterOwner = {
.preprocess = PreprocessAlterDistributedObjectStmt, .preprocess = PreprocessAlterDistributedObjectStmt,
.postprocess = PostprocessAlterDistributedObjectStmt, .postprocess = PostprocessAlterDistributedObjectStmt,
.objectType = OBJECT_FUNCTION, .objectType = OBJECT_FUNCTION,
.operationType = DIST_OPS_ALTER,
.address = AlterFunctionOwnerObjectAddress, .address = AlterFunctionOwnerObjectAddress,
.markDistributed = false, .markDistributed = false,
}; };
@ -829,6 +924,7 @@ static DistributeObjectOps Routine_Drop = {
.qualify = NULL, .qualify = NULL,
.preprocess = PreprocessDropDistributedObjectStmt, .preprocess = PreprocessDropDistributedObjectStmt,
.postprocess = NULL, .postprocess = NULL,
.operationType = DIST_OPS_DROP,
.address = NULL, .address = NULL,
.markDistributed = false, .markDistributed = false,
}; };
@ -837,6 +933,7 @@ static DistributeObjectOps Routine_Grant = {
.qualify = NULL, .qualify = NULL,
.preprocess = PreprocessGrantOnFunctionStmt, .preprocess = PreprocessGrantOnFunctionStmt,
.postprocess = PostprocessGrantOnFunctionStmt, .postprocess = PostprocessGrantOnFunctionStmt,
.operationType = DIST_OPS_ALTER,
.address = NULL, .address = NULL,
.markDistributed = false, .markDistributed = false,
}; };
@ -846,6 +943,7 @@ static DistributeObjectOps Routine_Rename = {
.preprocess = PreprocessAlterDistributedObjectStmt, .preprocess = PreprocessAlterDistributedObjectStmt,
.postprocess = NULL, .postprocess = NULL,
.objectType = OBJECT_FUNCTION, .objectType = OBJECT_FUNCTION,
.operationType = DIST_OPS_ALTER,
.address = RenameFunctionStmtObjectAddress, .address = RenameFunctionStmtObjectAddress,
.markDistributed = false, .markDistributed = false,
}; };
@ -854,6 +952,7 @@ static DistributeObjectOps Schema_Drop = {
.qualify = NULL, .qualify = NULL,
.preprocess = PreprocessDropSchemaStmt, .preprocess = PreprocessDropSchemaStmt,
.postprocess = NULL, .postprocess = NULL,
.operationType = DIST_OPS_DROP,
.address = NULL, .address = NULL,
.markDistributed = false, .markDistributed = false,
}; };
@ -862,6 +961,7 @@ static DistributeObjectOps Schema_Grant = {
.qualify = NULL, .qualify = NULL,
.preprocess = PreprocessGrantOnSchemaStmt, .preprocess = PreprocessGrantOnSchemaStmt,
.postprocess = NULL, .postprocess = NULL,
.operationType = DIST_OPS_ALTER,
.address = NULL, .address = NULL,
.markDistributed = false, .markDistributed = false,
}; };
@ -871,6 +971,7 @@ static DistributeObjectOps Schema_Rename = {
.preprocess = PreprocessAlterDistributedObjectStmt, .preprocess = PreprocessAlterDistributedObjectStmt,
.postprocess = NULL, .postprocess = NULL,
.objectType = OBJECT_SCHEMA, .objectType = OBJECT_SCHEMA,
.operationType = DIST_OPS_ALTER,
.address = AlterSchemaRenameStmtObjectAddress, .address = AlterSchemaRenameStmtObjectAddress,
.markDistributed = false, .markDistributed = false,
}; };
@ -879,6 +980,7 @@ static DistributeObjectOps Statistics_Alter = {
.qualify = QualifyAlterStatisticsStmt, .qualify = QualifyAlterStatisticsStmt,
.preprocess = PreprocessAlterStatisticsStmt, .preprocess = PreprocessAlterStatisticsStmt,
.postprocess = NULL, .postprocess = NULL,
.operationType = DIST_OPS_ALTER,
.address = NULL, .address = NULL,
.markDistributed = false, .markDistributed = false,
}; };
@ -887,6 +989,7 @@ static DistributeObjectOps Statistics_AlterObjectSchema = {
.qualify = QualifyAlterStatisticsSchemaStmt, .qualify = QualifyAlterStatisticsSchemaStmt,
.preprocess = PreprocessAlterStatisticsSchemaStmt, .preprocess = PreprocessAlterStatisticsSchemaStmt,
.postprocess = PostprocessAlterStatisticsSchemaStmt, .postprocess = PostprocessAlterStatisticsSchemaStmt,
.operationType = DIST_OPS_ALTER,
.address = AlterStatisticsSchemaStmtObjectAddress, .address = AlterStatisticsSchemaStmtObjectAddress,
.markDistributed = false, .markDistributed = false,
}; };
@ -894,6 +997,7 @@ static DistributeObjectOps Statistics_AlterOwner = {
.deparse = DeparseAlterStatisticsOwnerStmt, .deparse = DeparseAlterStatisticsOwnerStmt,
.qualify = QualifyAlterStatisticsOwnerStmt, .qualify = QualifyAlterStatisticsOwnerStmt,
.preprocess = PreprocessAlterStatisticsOwnerStmt, .preprocess = PreprocessAlterStatisticsOwnerStmt,
.operationType = DIST_OPS_ALTER,
.postprocess = PostprocessAlterStatisticsOwnerStmt, .postprocess = PostprocessAlterStatisticsOwnerStmt,
.address = NULL, .address = NULL,
.markDistributed = false, .markDistributed = false,
@ -903,6 +1007,7 @@ static DistributeObjectOps Statistics_Drop = {
.qualify = QualifyDropStatisticsStmt, .qualify = QualifyDropStatisticsStmt,
.preprocess = PreprocessDropStatisticsStmt, .preprocess = PreprocessDropStatisticsStmt,
.postprocess = NULL, .postprocess = NULL,
.operationType = DIST_OPS_DROP,
.address = DropStatisticsObjectAddress, .address = DropStatisticsObjectAddress,
.markDistributed = false, .markDistributed = false,
}; };
@ -911,6 +1016,7 @@ static DistributeObjectOps Statistics_Rename = {
.qualify = QualifyAlterStatisticsRenameStmt, .qualify = QualifyAlterStatisticsRenameStmt,
.preprocess = PreprocessAlterStatisticsRenameStmt, .preprocess = PreprocessAlterStatisticsRenameStmt,
.postprocess = NULL, .postprocess = NULL,
.operationType = DIST_OPS_ALTER,
.address = NULL, .address = NULL,
.markDistributed = false, .markDistributed = false,
}; };
@ -919,6 +1025,7 @@ static DistributeObjectOps Table_AlterTable = {
.qualify = NULL, .qualify = NULL,
.preprocess = PreprocessAlterTableStmt, .preprocess = PreprocessAlterTableStmt,
.postprocess = NULL, .postprocess = NULL,
.operationType = DIST_OPS_ALTER,
.address = NULL, .address = NULL,
.markDistributed = false, .markDistributed = false,
}; };
@ -927,6 +1034,7 @@ static DistributeObjectOps Table_AlterObjectSchema = {
.qualify = QualifyAlterTableSchemaStmt, .qualify = QualifyAlterTableSchemaStmt,
.preprocess = PreprocessAlterTableSchemaStmt, .preprocess = PreprocessAlterTableSchemaStmt,
.postprocess = PostprocessAlterTableSchemaStmt, .postprocess = PostprocessAlterTableSchemaStmt,
.operationType = DIST_OPS_ALTER,
.address = AlterTableSchemaStmtObjectAddress, .address = AlterTableSchemaStmtObjectAddress,
.markDistributed = false, .markDistributed = false,
}; };
@ -935,6 +1043,7 @@ static DistributeObjectOps Table_Drop = {
.qualify = NULL, .qualify = NULL,
.preprocess = PreprocessDropTableStmt, .preprocess = PreprocessDropTableStmt,
.postprocess = NULL, .postprocess = NULL,
.operationType = DIST_OPS_DROP,
.address = NULL, .address = NULL,
.markDistributed = false, .markDistributed = false,
}; };
@ -944,6 +1053,7 @@ static DistributeObjectOps Type_AlterObjectSchema = {
.preprocess = PreprocessAlterDistributedObjectStmt, .preprocess = PreprocessAlterDistributedObjectStmt,
.postprocess = PostprocessAlterDistributedObjectStmt, .postprocess = PostprocessAlterDistributedObjectStmt,
.objectType = OBJECT_TYPE, .objectType = OBJECT_TYPE,
.operationType = DIST_OPS_ALTER,
.address = AlterTypeSchemaStmtObjectAddress, .address = AlterTypeSchemaStmtObjectAddress,
.markDistributed = false, .markDistributed = false,
}; };
@ -960,6 +1070,7 @@ static DistributeObjectOps View_AlterObjectSchema = {
.qualify = QualifyAlterViewSchemaStmt, .qualify = QualifyAlterViewSchemaStmt,
.preprocess = PreprocessAlterViewSchemaStmt, .preprocess = PreprocessAlterViewSchemaStmt,
.postprocess = PostprocessAlterViewSchemaStmt, .postprocess = PostprocessAlterViewSchemaStmt,
.operationType = DIST_OPS_ALTER,
.address = AlterViewSchemaStmtObjectAddress, .address = AlterViewSchemaStmtObjectAddress,
.markDistributed = false, .markDistributed = false,
}; };
@ -969,6 +1080,7 @@ static DistributeObjectOps Type_AlterOwner = {
.preprocess = PreprocessAlterDistributedObjectStmt, .preprocess = PreprocessAlterDistributedObjectStmt,
.postprocess = PostprocessAlterDistributedObjectStmt, .postprocess = PostprocessAlterDistributedObjectStmt,
.objectType = OBJECT_TYPE, .objectType = OBJECT_TYPE,
.operationType = DIST_OPS_ALTER,
.address = AlterTypeOwnerObjectAddress, .address = AlterTypeOwnerObjectAddress,
.markDistributed = false, .markDistributed = false,
}; };
@ -978,6 +1090,7 @@ static DistributeObjectOps Type_AlterTable = {
.preprocess = PreprocessAlterDistributedObjectStmt, .preprocess = PreprocessAlterDistributedObjectStmt,
.postprocess = NULL, .postprocess = NULL,
.objectType = OBJECT_TYPE, .objectType = OBJECT_TYPE,
.operationType = DIST_OPS_ALTER,
.address = AlterTypeStmtObjectAddress, .address = AlterTypeStmtObjectAddress,
.markDistributed = false, .markDistributed = false,
}; };
@ -994,6 +1107,7 @@ static DistributeObjectOps View_AlterView = {
.qualify = QualifyAlterViewStmt, .qualify = QualifyAlterViewStmt,
.preprocess = PreprocessAlterViewStmt, .preprocess = PreprocessAlterViewStmt,
.postprocess = PostprocessAlterViewStmt, .postprocess = PostprocessAlterViewStmt,
.operationType = DIST_OPS_ALTER,
.address = AlterViewStmtObjectAddress, .address = AlterViewStmtObjectAddress,
.markDistributed = false, .markDistributed = false,
}; };
@ -1002,6 +1116,7 @@ static DistributeObjectOps Type_Drop = {
.qualify = NULL, .qualify = NULL,
.preprocess = PreprocessDropDistributedObjectStmt, .preprocess = PreprocessDropDistributedObjectStmt,
.postprocess = NULL, .postprocess = NULL,
.operationType = DIST_OPS_DROP,
.address = NULL, .address = NULL,
.markDistributed = false, .markDistributed = false,
}; };
@ -1010,6 +1125,7 @@ static DistributeObjectOps Trigger_Drop = {
.qualify = NULL, .qualify = NULL,
.preprocess = PreprocessDropTriggerStmt, .preprocess = PreprocessDropTriggerStmt,
.postprocess = NULL, .postprocess = NULL,
.operationType = DIST_OPS_DROP,
.address = NULL, .address = NULL,
.markDistributed = false, .markDistributed = false,
}; };
@ -1019,6 +1135,7 @@ static DistributeObjectOps Type_Rename = {
.preprocess = PreprocessAlterDistributedObjectStmt, .preprocess = PreprocessAlterDistributedObjectStmt,
.postprocess = NULL, .postprocess = NULL,
.objectType = OBJECT_TYPE, .objectType = OBJECT_TYPE,
.operationType = DIST_OPS_ALTER,
.address = RenameTypeStmtObjectAddress, .address = RenameTypeStmtObjectAddress,
.markDistributed = false, .markDistributed = false,
}; };
@ -1027,6 +1144,7 @@ static DistributeObjectOps Vacuum_Analyze = {
.qualify = NULL, .qualify = NULL,
.preprocess = NULL, .preprocess = NULL,
.postprocess = PostprocessVacuumStmt, .postprocess = PostprocessVacuumStmt,
.operationType = DIST_OPS_NONE,
.address = NULL, .address = NULL,
.markDistributed = false, .markDistributed = false,
}; };
@ -1042,6 +1160,7 @@ static DistributeObjectOps View_Rename = {
.qualify = QualifyRenameViewStmt, .qualify = QualifyRenameViewStmt,
.preprocess = PreprocessRenameViewStmt, .preprocess = PreprocessRenameViewStmt,
.postprocess = NULL, .postprocess = NULL,
.operationType = DIST_OPS_ALTER,
.address = RenameViewStmtObjectAddress, .address = RenameViewStmtObjectAddress,
.markDistributed = false, .markDistributed = false,
}; };
@ -1049,6 +1168,7 @@ static DistributeObjectOps Trigger_Rename = {
.deparse = NULL, .deparse = NULL,
.qualify = NULL, .qualify = NULL,
.preprocess = NULL, .preprocess = NULL,
.operationType = DIST_OPS_ALTER,
.postprocess = PostprocessAlterTriggerRenameStmt, .postprocess = PostprocessAlterTriggerRenameStmt,
.address = NULL, .address = NULL,
.markDistributed = false, .markDistributed = false,

View File

@ -124,6 +124,13 @@ RoleSpecToObjectAddress(RoleSpec *role, bool missing_ok)
Oid roleOid = get_rolespec_oid(role, missing_ok); Oid roleOid = get_rolespec_oid(role, missing_ok);
ObjectAddressSet(*address, AuthIdRelationId, roleOid); ObjectAddressSet(*address, AuthIdRelationId, roleOid);
} }
else
{
/*
* If rolespec is null, role can be 'ALL'. We should be returning a pseudo-valid oid.
*/
ObjectAddressSet(*address, AuthIdRelationId, OID_MAX);
}
return list_make1(address); return list_make1(address);
} }

View File

@ -359,9 +359,19 @@ AlterStatisticsSchemaStmtObjectAddress(Node *node, bool missingOk)
AlterObjectSchemaStmt *stmt = castNode(AlterObjectSchemaStmt, node); AlterObjectSchemaStmt *stmt = castNode(AlterObjectSchemaStmt, node);
ObjectAddress *address = palloc0(sizeof(ObjectAddress)); ObjectAddress *address = palloc0(sizeof(ObjectAddress));
String *statName = llast((List *) stmt->object); List *statName = (List *) stmt->object;
Oid statsOid = get_statistics_object_oid(list_make2(makeString(stmt->newschema), Oid statsOid = get_statistics_object_oid(statName, true);
statName), missingOk);
if (statsOid == InvalidOid)
{
/*
* couldn't find the stat, might have already been moved to the new schema, we
* construct a new stat name that uses the new schema to search in.
*/
List *newStatName = list_make2(makeString(stmt->newschema), llast(statName));
statsOid = get_statistics_object_oid(newStatName, missingOk);
}
ObjectAddressSet(*address, StatisticExtRelationId, statsOid); ObjectAddressSet(*address, StatisticExtRelationId, statsOid);
return list_make1(address); return list_make1(address);

View File

@ -550,7 +550,10 @@ ProcessUtilityInternal(PlannedStmt *pstmt,
* Therefore, we first check if all addresses in the given statement are valid. * Therefore, we first check if all addresses in the given statement are valid.
* Then, we do not execute qualify and preprocess if any address is invalid to * Then, we do not execute qualify and preprocess if any address is invalid to
* prevent before-mentioned citus related messages. PG will complain about the * prevent before-mentioned citus related messages. PG will complain about the
* invalid address, so we are safe to not execute qualify and preprocess. * invalid address, so we are safe to not execute qualify and preprocess. Also
* note that we should not guard any step after standardProcess_Utility with
* the flag distOpsHasInvalidObject because PG would have already failed the
* transaction.
*/ */
distOpsHasInvalidObject = DistOpsHasInvalidObject(parsetree, ops); distOpsHasInvalidObject = DistOpsHasInvalidObject(parsetree, ops);

View File

@ -32,6 +32,7 @@
#include "catalog/pg_type.h" #include "catalog/pg_type.h"
#include "distributed/citus_depended_object.h" #include "distributed/citus_depended_object.h"
#include "distributed/metadata_cache.h" #include "distributed/metadata_cache.h"
#include "distributed/commands.h"
#include "distributed/listutils.h" #include "distributed/listutils.h"
#include "distributed/log_utils.h" #include "distributed/log_utils.h"
#include "distributed/shared_library_init.h" #include "distributed/shared_library_init.h"
@ -48,6 +49,8 @@ bool HideCitusDependentObjects = false;
static Node * CreateCitusDependentObjectExpr(int pgMetaTableVarno, int pgMetaTableOid); static Node * CreateCitusDependentObjectExpr(int pgMetaTableVarno, int pgMetaTableOid);
static List * GetCitusDependedObjectArgs(int pgMetaTableVarno, int pgMetaTableOid); static List * GetCitusDependedObjectArgs(int pgMetaTableVarno, int pgMetaTableOid);
static bool StatementContainsIfExist(Node *node);
static bool AlterRoleSetStatementContainsAll(Node *node);
/* /*
* IsPgLocksTable returns true if RTE is pg_locks table. * IsPgLocksTable returns true if RTE is pg_locks table.
@ -315,12 +318,26 @@ GetCitusDependedObjectArgs(int pgMetaTableVarno, int pgMetaTableOid)
* is invalid; otherwise, returns false. If ops is null or it has no * is invalid; otherwise, returns false. If ops is null or it has no
* implemented address method, we return false. * implemented address method, we return false.
* *
* If EnableUnsupportedFeatureMessages is active, then we return false. * We have some dist ops for which we should not validate.
* 1) We should not validate CREATE statements because no address exists
* here yet.
* 2) We should not validate '[DROP|ALTER] IF EXISTS' statements because it is ok
* by the semantics even if any object is invalid.
* 3) We should not validate 'ALTER ROLE ALL [SET|UNSET] because for the role ALL
* AlterRoleSetStmtObjectAddress returns an invalid address even though it should not.
*/ */
bool bool
DistOpsHasInvalidObject(Node *node, const DistributeObjectOps *ops) DistOpsHasInvalidObject(Node *node, const DistributeObjectOps *ops)
{ {
if (EnableUnsupportedFeatureMessages) if (ops && ops->operationType == DIST_OPS_CREATE)
{
return false;
}
else if (StatementContainsIfExist(node))
{
return false;
}
else if (AlterRoleSetStatementContainsAll(node))
{ {
return false; return false;
} }
@ -340,3 +357,131 @@ DistOpsHasInvalidObject(Node *node, const DistributeObjectOps *ops)
return false; return false;
} }
/*
* StatementContainsIfExist returns true if the statement contains
* IF EXIST syntax.
*/
static bool
StatementContainsIfExist(Node *node)
{
if (node == NULL)
{
return false;
}
switch (nodeTag(node))
{
case T_DropStmt:
{
DropStmt *dropStmt = castNode(DropStmt, node);
return dropStmt->missing_ok;
}
case T_DropRoleStmt:
{
DropRoleStmt *dropRoleStmt = castNode(DropRoleStmt, node);
return dropRoleStmt->missing_ok;
}
case T_DropdbStmt:
{
DropdbStmt *dropdbStmt = castNode(DropdbStmt, node);
return dropdbStmt->missing_ok;
}
case T_DropTableSpaceStmt:
{
DropTableSpaceStmt *dropTableSpaceStmt = castNode(DropTableSpaceStmt, node);
return dropTableSpaceStmt->missing_ok;
}
case T_DropUserMappingStmt:
{
DropUserMappingStmt *dropUserMappingStmt = castNode(DropUserMappingStmt,
node);
return dropUserMappingStmt->missing_ok;
}
case T_DropSubscriptionStmt:
{
DropSubscriptionStmt *dropSubscriptionStmt = castNode(DropSubscriptionStmt,
node);
return dropSubscriptionStmt->missing_ok;
}
case T_AlterTableStmt:
{
AlterTableStmt *alterTableStmt = castNode(AlterTableStmt, node);
return alterTableStmt->missing_ok;
}
case T_AlterDomainStmt:
{
AlterDomainStmt *alterDomainStmt = castNode(AlterDomainStmt, node);
return alterDomainStmt->missing_ok;
}
case T_AlterSeqStmt:
{
AlterSeqStmt *alterSeqStmt = castNode(AlterSeqStmt, node);
return alterSeqStmt->missing_ok;
}
case T_AlterStatsStmt:
{
AlterStatsStmt *alterStatsStmt = castNode(AlterStatsStmt, node);
return alterStatsStmt->missing_ok;
}
case T_RenameStmt:
{
RenameStmt *renameStmt = castNode(RenameStmt, node);
return renameStmt->missing_ok;
}
case T_AlterObjectSchemaStmt:
{
AlterObjectSchemaStmt *alterObjectSchemaStmt = castNode(AlterObjectSchemaStmt,
node);
return alterObjectSchemaStmt->missing_ok;
}
case T_AlterTSConfigurationStmt:
{
AlterTSConfigurationStmt *alterTSConfigurationStmt = castNode(
AlterTSConfigurationStmt, node);
return alterTSConfigurationStmt->missing_ok;
}
default:
{
return false;
}
}
}
/*
* AlterRoleSetStatementContainsAll returns true if the statement is a
* ALTER ROLE ALL (SET / RESET).
*/
static bool
AlterRoleSetStatementContainsAll(Node *node)
{
if (node == NULL)
{
return false;
}
if (nodeTag(node) == T_AlterRoleSetStmt)
{
/* rolespec is null for the role 'ALL' */
AlterRoleSetStmt *alterRoleSetStmt = castNode(AlterRoleSetStmt, node);
return alterRoleSetStmt->role == NULL;
}
return false;
}

View File

@ -39,6 +39,14 @@ extern void SwitchToSequentialAndLocalExecutionIfPartitionNameTooLong(Oid
Oid Oid
partitionRelationId); partitionRelationId);
typedef enum DistOpsOperationType
{
DIST_OPS_NONE,
DIST_OPS_CREATE,
DIST_OPS_ALTER,
DIST_OPS_DROP,
} DistOpsOperationType;
/* /*
* DistributeObjectOps specifies handlers for node/object type pairs. * DistributeObjectOps specifies handlers for node/object type pairs.
@ -74,6 +82,9 @@ typedef struct DistributeObjectOps
* common propagation functions will not propagate the creation of the object. * common propagation functions will not propagate the creation of the object.
*/ */
bool *featureFlag; bool *featureFlag;
/* specifies the type of the operation */
DistOpsOperationType operationType;
} DistributeObjectOps; } DistributeObjectOps;
#define CITUS_TRUNCATE_TRIGGER_NAME "citus_truncate_trigger" #define CITUS_TRUNCATE_TRIGGER_NAME "citus_truncate_trigger"