rename Pre/PostprocessAlterDistributedObjectStmt to Pre/PostprocessAlterDistributedObjectStmtFromCoordinator

ddl-from-any-node-phase-1
Onur Tirtir 2025-10-24 13:51:22 +03:00
parent 8388b80dd3
commit 25507a5804
5 changed files with 88 additions and 85 deletions

View File

@ -1819,13 +1819,13 @@ Each field in the struct is documented in the comments within the `DistributeObj
- **Returning tasks for `preprocess` and `postprocess`**: Ensure that either `preprocess` or `postprocess` returns a list of "DDLJob"s. If both functions return non-empty lists, then you would get an assertion failure. - **Returning tasks for `preprocess` and `postprocess`**: Ensure that either `preprocess` or `postprocess` returns a list of "DDLJob"s. If both functions return non-empty lists, then you would get an assertion failure.
- **Generic `preprocess` and `postprocess` methods**: The generic methods, `PreprocessAlterDistributedObjectStmt` and `PostprocessAlterDistributedObjectStmt`, serve as generic pre and post methods utilized for various statements. Both of these methods find application in distributed object operations. - **Generic `preprocess` and `postprocess` methods**: The generic methods, `PreprocessAlterDistributedObjectStmtFromCoordinator` and `PostprocessAlterDistributedObjectStmtFromCoordinator`, serve as generic pre and post methods utilized for various statements. Both of these methods find application in distributed object operations.
- The `PreprocessAlterDistributedObjectStmt` method carries out the following operations: - The `PreprocessAlterDistributedObjectStmtFromCoordinator` method carries out the following operations:
- Performs a qualification operation. - Performs a qualification operation.
- Deparses the statement and generates a task list. - Deparses the statement and generates a task list.
- As for the `PostprocessAlterDistributedObjectStmt` method, it: - As for the `PostprocessAlterDistributedObjectStmtFromCoordinator` method, it:
- Invokes the `EnsureAllObjectDependenciesExistOnAllNodes` function to propagate missing dependencies, both on the coordinator and the worker. - Invokes the `EnsureAllObjectDependenciesExistOnAllNodes` function to propagate missing dependencies, both on the coordinator and the worker.
- Before defining new `preprocess` or `postprocess` methods, it is advisable to assess whether the generic methods can be employed in your specific case. - Before defining new `preprocess` or `postprocess` methods, it is advisable to assess whether the generic methods can be employed in your specific case.

View File

@ -104,8 +104,8 @@ PostprocessCreateDistributedObjectFromCatalogStmt(Node *stmt, const char *queryS
/* /*
* PreprocessAlterDistributedObjectStmt handles any updates to distributed objects by * PreprocessAlterDistributedObjectStmtFromCoordinator handles any updates to distributed
* creating the fully qualified sql to apply to all workers after checking all * objects by creating the fully qualified sql to apply to all workers after checking all
* predconditions that apply to propagating changes. * predconditions that apply to propagating changes.
* *
* Preconditions are (in order): * Preconditions are (in order):
@ -123,8 +123,9 @@ PostprocessCreateDistributedObjectFromCatalogStmt(Node *stmt, const char *queryS
* recursion of propagation with Citus' MX functionality. * recursion of propagation with Citus' MX functionality.
*/ */
List * List *
PreprocessAlterDistributedObjectStmt(Node *stmt, const char *queryString, PreprocessAlterDistributedObjectStmtFromCoordinator(Node *stmt, const char *queryString,
ProcessUtilityContext processUtilityContext) ProcessUtilityContext
processUtilityContext)
{ {
const DistributeObjectOps *ops = GetDistributeObjectOps(stmt); const DistributeObjectOps *ops = GetDistributeObjectOps(stmt);
Assert(ops != NULL); Assert(ops != NULL);
@ -160,9 +161,9 @@ PreprocessAlterDistributedObjectStmt(Node *stmt, const char *queryString,
/* /*
* PostprocessAlterDistributedObjectStmt is the counter part of * PostprocessAlterDistributedObjectStmtFromCoordinator is the counter part of
* PreprocessAlterDistributedObjectStmt that should be executed after the object has been * PreprocessAlterDistributedObjectStmtFromCoordinator that should be executed after the
* changed locally. * object has been changed locally.
* *
* We perform the same precondition checks as before to skip this operation if any of the * We perform the same precondition checks as before to skip this operation if any of the
* failed during preprocessing. Since we already raised an error on other checks we don't * failed during preprocessing. Since we already raised an error on other checks we don't
@ -173,7 +174,7 @@ PreprocessAlterDistributedObjectStmt(Node *stmt, const char *queryString,
* they get created on the workers before we send the command list to the workers. * they get created on the workers before we send the command list to the workers.
*/ */
List * List *
PostprocessAlterDistributedObjectStmt(Node *stmt, const char *queryString) PostprocessAlterDistributedObjectStmtFromCoordinator(Node *stmt, const char *queryString)
{ {
const DistributeObjectOps *ops = GetDistributeObjectOps(stmt); const DistributeObjectOps *ops = GetDistributeObjectOps(stmt);
Assert(ops != NULL); Assert(ops != NULL);

View File

@ -32,8 +32,8 @@ static DistributeObjectOps NoDistributeOps = {
static DistributeObjectOps Aggregate_AlterObjectSchema = { static DistributeObjectOps Aggregate_AlterObjectSchema = {
.deparse = DeparseAlterFunctionSchemaStmt, .deparse = DeparseAlterFunctionSchemaStmt,
.qualify = QualifyAlterFunctionSchemaStmt, .qualify = QualifyAlterFunctionSchemaStmt,
.preprocess = PreprocessAlterDistributedObjectStmt, .preprocess = PreprocessAlterDistributedObjectStmtFromCoordinator,
.postprocess = PostprocessAlterDistributedObjectStmt, .postprocess = PostprocessAlterDistributedObjectStmtFromCoordinator,
.objectType = OBJECT_FUNCTION, .objectType = OBJECT_FUNCTION,
.operationType = DIST_OPS_ALTER, .operationType = DIST_OPS_ALTER,
.address = AlterFunctionSchemaStmtObjectAddress, .address = AlterFunctionSchemaStmtObjectAddress,
@ -42,8 +42,8 @@ static DistributeObjectOps Aggregate_AlterObjectSchema = {
static DistributeObjectOps Aggregate_AlterOwner = { static DistributeObjectOps Aggregate_AlterOwner = {
.deparse = DeparseAlterFunctionOwnerStmt, .deparse = DeparseAlterFunctionOwnerStmt,
.qualify = QualifyAlterFunctionOwnerStmt, .qualify = QualifyAlterFunctionOwnerStmt,
.preprocess = PreprocessAlterDistributedObjectStmt, .preprocess = PreprocessAlterDistributedObjectStmtFromCoordinator,
.postprocess = PostprocessAlterDistributedObjectStmt, .postprocess = PostprocessAlterDistributedObjectStmtFromCoordinator,
.objectType = OBJECT_FUNCTION, .objectType = OBJECT_FUNCTION,
.operationType = DIST_OPS_ALTER, .operationType = DIST_OPS_ALTER,
.address = AlterFunctionOwnerObjectAddress, .address = AlterFunctionOwnerObjectAddress,
@ -71,7 +71,7 @@ static DistributeObjectOps Aggregate_Drop = {
static DistributeObjectOps Aggregate_Rename = { static DistributeObjectOps Aggregate_Rename = {
.deparse = DeparseRenameFunctionStmt, .deparse = DeparseRenameFunctionStmt,
.qualify = QualifyRenameFunctionStmt, .qualify = QualifyRenameFunctionStmt,
.preprocess = PreprocessAlterDistributedObjectStmt, .preprocess = PreprocessAlterDistributedObjectStmtFromCoordinator,
.postprocess = NULL, .postprocess = NULL,
.objectType = OBJECT_FUNCTION, .objectType = OBJECT_FUNCTION,
.operationType = DIST_OPS_ALTER, .operationType = DIST_OPS_ALTER,
@ -90,7 +90,7 @@ static DistributeObjectOps Aggregate_Grant = {
static DistributeObjectOps Any_AlterEnum = { static DistributeObjectOps Any_AlterEnum = {
.deparse = DeparseAlterEnumStmt, .deparse = DeparseAlterEnumStmt,
.qualify = QualifyAlterEnumStmt, .qualify = QualifyAlterEnumStmt,
.preprocess = PreprocessAlterDistributedObjectStmt, .preprocess = PreprocessAlterDistributedObjectStmtFromCoordinator,
.postprocess = NULL, .postprocess = NULL,
.objectType = OBJECT_TYPE, .objectType = OBJECT_TYPE,
.operationType = DIST_OPS_ALTER, .operationType = DIST_OPS_ALTER,
@ -118,7 +118,7 @@ static DistributeObjectOps Any_AlterExtensionContents = {
static DistributeObjectOps Any_AlterForeignServer = { static DistributeObjectOps Any_AlterForeignServer = {
.deparse = DeparseAlterForeignServerStmt, .deparse = DeparseAlterForeignServerStmt,
.qualify = NULL, .qualify = NULL,
.preprocess = PreprocessAlterDistributedObjectStmt, .preprocess = PreprocessAlterDistributedObjectStmtFromCoordinator,
.postprocess = NULL, .postprocess = NULL,
.objectType = OBJECT_FOREIGN_SERVER, .objectType = OBJECT_FOREIGN_SERVER,
.operationType = DIST_OPS_ALTER, .operationType = DIST_OPS_ALTER,
@ -309,7 +309,7 @@ static DistributeObjectOps Any_DropRole = {
static DistributeObjectOps Role_Comment = { static DistributeObjectOps Role_Comment = {
.deparse = DeparseCommentStmt, .deparse = DeparseCommentStmt,
.qualify = NULL, .qualify = NULL,
.preprocess = PreprocessAlterDistributedObjectStmt, .preprocess = PreprocessAlterDistributedObjectStmtFromCoordinator,
.postprocess = NULL, .postprocess = NULL,
.objectType = OBJECT_DATABASE, .objectType = OBJECT_DATABASE,
.operationType = DIST_OPS_ALTER, .operationType = DIST_OPS_ALTER,
@ -446,8 +446,8 @@ static DistributeObjectOps Attribute_Rename = {
static DistributeObjectOps Collation_AlterObjectSchema = { static DistributeObjectOps Collation_AlterObjectSchema = {
.deparse = DeparseAlterCollationSchemaStmt, .deparse = DeparseAlterCollationSchemaStmt,
.qualify = QualifyAlterCollationSchemaStmt, .qualify = QualifyAlterCollationSchemaStmt,
.preprocess = PreprocessAlterDistributedObjectStmt, .preprocess = PreprocessAlterDistributedObjectStmtFromCoordinator,
.postprocess = PostprocessAlterDistributedObjectStmt, .postprocess = PostprocessAlterDistributedObjectStmtFromCoordinator,
.objectType = OBJECT_COLLATION, .objectType = OBJECT_COLLATION,
.operationType = DIST_OPS_ALTER, .operationType = DIST_OPS_ALTER,
.address = AlterCollationSchemaStmtObjectAddress, .address = AlterCollationSchemaStmtObjectAddress,
@ -456,8 +456,8 @@ static DistributeObjectOps Collation_AlterObjectSchema = {
static DistributeObjectOps Collation_AlterOwner = { static DistributeObjectOps Collation_AlterOwner = {
.deparse = DeparseAlterCollationOwnerStmt, .deparse = DeparseAlterCollationOwnerStmt,
.qualify = QualifyAlterCollationOwnerStmt, .qualify = QualifyAlterCollationOwnerStmt,
.preprocess = PreprocessAlterDistributedObjectStmt, .preprocess = PreprocessAlterDistributedObjectStmtFromCoordinator,
.postprocess = PostprocessAlterDistributedObjectStmt, .postprocess = PostprocessAlterDistributedObjectStmtFromCoordinator,
.objectType = OBJECT_COLLATION, .objectType = OBJECT_COLLATION,
.operationType = DIST_OPS_ALTER, .operationType = DIST_OPS_ALTER,
.address = AlterCollationOwnerObjectAddress, .address = AlterCollationOwnerObjectAddress,
@ -485,7 +485,7 @@ static DistributeObjectOps Collation_Drop = {
static DistributeObjectOps Collation_Rename = { static DistributeObjectOps Collation_Rename = {
.deparse = DeparseRenameCollationStmt, .deparse = DeparseRenameCollationStmt,
.qualify = QualifyRenameCollationStmt, .qualify = QualifyRenameCollationStmt,
.preprocess = PreprocessAlterDistributedObjectStmt, .preprocess = PreprocessAlterDistributedObjectStmtFromCoordinator,
.postprocess = NULL, .postprocess = NULL,
.objectType = OBJECT_COLLATION, .objectType = OBJECT_COLLATION,
.operationType = DIST_OPS_ALTER, .operationType = DIST_OPS_ALTER,
@ -495,8 +495,8 @@ static DistributeObjectOps Collation_Rename = {
static DistributeObjectOps Database_AlterOwner = { static DistributeObjectOps Database_AlterOwner = {
.deparse = DeparseAlterDatabaseOwnerStmt, .deparse = DeparseAlterDatabaseOwnerStmt,
.qualify = NULL, .qualify = NULL,
.preprocess = PreprocessAlterDistributedObjectStmt, .preprocess = PreprocessAlterDistributedObjectStmtFromCoordinator,
.postprocess = PostprocessAlterDistributedObjectStmt, .postprocess = PostprocessAlterDistributedObjectStmtFromCoordinator,
.objectType = OBJECT_DATABASE, .objectType = OBJECT_DATABASE,
.operationType = DIST_OPS_ALTER, .operationType = DIST_OPS_ALTER,
.featureFlag = &EnableAlterDatabaseOwner, .featureFlag = &EnableAlterDatabaseOwner,
@ -573,7 +573,7 @@ static DistributeObjectOps Database_Set = {
static DistributeObjectOps Database_Comment = { static DistributeObjectOps Database_Comment = {
.deparse = DeparseCommentStmt, .deparse = DeparseCommentStmt,
.qualify = NULL, .qualify = NULL,
.preprocess = PreprocessAlterDistributedObjectStmt, .preprocess = PreprocessAlterDistributedObjectStmtFromCoordinator,
.postprocess = NULL, .postprocess = NULL,
.objectType = OBJECT_DATABASE, .objectType = OBJECT_DATABASE,
.operationType = DIST_OPS_ALTER, .operationType = DIST_OPS_ALTER,
@ -595,8 +595,8 @@ static DistributeObjectOps Database_Rename = {
static DistributeObjectOps Domain_Alter = { static DistributeObjectOps Domain_Alter = {
.deparse = DeparseAlterDomainStmt, .deparse = DeparseAlterDomainStmt,
.qualify = QualifyAlterDomainStmt, .qualify = QualifyAlterDomainStmt,
.preprocess = PreprocessAlterDistributedObjectStmt, .preprocess = PreprocessAlterDistributedObjectStmtFromCoordinator,
.postprocess = PostprocessAlterDistributedObjectStmt, .postprocess = PostprocessAlterDistributedObjectStmtFromCoordinator,
.objectType = OBJECT_DOMAIN, .objectType = OBJECT_DOMAIN,
.operationType = DIST_OPS_ALTER, .operationType = DIST_OPS_ALTER,
.address = AlterDomainStmtObjectAddress, .address = AlterDomainStmtObjectAddress,
@ -605,8 +605,8 @@ static DistributeObjectOps Domain_Alter = {
static DistributeObjectOps Domain_AlterObjectSchema = { static DistributeObjectOps Domain_AlterObjectSchema = {
.deparse = DeparseAlterDomainSchemaStmt, .deparse = DeparseAlterDomainSchemaStmt,
.qualify = QualifyAlterDomainSchemaStmt, .qualify = QualifyAlterDomainSchemaStmt,
.preprocess = PreprocessAlterDistributedObjectStmt, .preprocess = PreprocessAlterDistributedObjectStmtFromCoordinator,
.postprocess = PostprocessAlterDistributedObjectStmt, .postprocess = PostprocessAlterDistributedObjectStmtFromCoordinator,
.objectType = OBJECT_DOMAIN, .objectType = OBJECT_DOMAIN,
.operationType = DIST_OPS_ALTER, .operationType = DIST_OPS_ALTER,
.address = AlterTypeSchemaStmtObjectAddress, .address = AlterTypeSchemaStmtObjectAddress,
@ -615,8 +615,8 @@ static DistributeObjectOps Domain_AlterObjectSchema = {
static DistributeObjectOps Domain_AlterOwner = { static DistributeObjectOps Domain_AlterOwner = {
.deparse = DeparseAlterDomainOwnerStmt, .deparse = DeparseAlterDomainOwnerStmt,
.qualify = QualifyAlterDomainOwnerStmt, .qualify = QualifyAlterDomainOwnerStmt,
.preprocess = PreprocessAlterDistributedObjectStmt, .preprocess = PreprocessAlterDistributedObjectStmtFromCoordinator,
.postprocess = PostprocessAlterDistributedObjectStmt, .postprocess = PostprocessAlterDistributedObjectStmtFromCoordinator,
.objectType = OBJECT_DOMAIN, .objectType = OBJECT_DOMAIN,
.operationType = DIST_OPS_ALTER, .operationType = DIST_OPS_ALTER,
.address = AlterDomainOwnerStmtObjectAddress, .address = AlterDomainOwnerStmtObjectAddress,
@ -634,7 +634,7 @@ static DistributeObjectOps Domain_Drop = {
static DistributeObjectOps Domain_Rename = { static DistributeObjectOps Domain_Rename = {
.deparse = DeparseRenameDomainStmt, .deparse = DeparseRenameDomainStmt,
.qualify = QualifyRenameDomainStmt, .qualify = QualifyRenameDomainStmt,
.preprocess = PreprocessAlterDistributedObjectStmt, .preprocess = PreprocessAlterDistributedObjectStmtFromCoordinator,
.postprocess = NULL, .postprocess = NULL,
.objectType = OBJECT_DOMAIN, .objectType = OBJECT_DOMAIN,
.operationType = DIST_OPS_ALTER, .operationType = DIST_OPS_ALTER,
@ -645,7 +645,7 @@ static DistributeObjectOps Domain_Rename = {
static DistributeObjectOps Domain_RenameConstraint = { static DistributeObjectOps Domain_RenameConstraint = {
.deparse = DeparseDomainRenameConstraintStmt, .deparse = DeparseDomainRenameConstraintStmt,
.qualify = QualifyDomainRenameConstraintStmt, .qualify = QualifyDomainRenameConstraintStmt,
.preprocess = PreprocessAlterDistributedObjectStmt, .preprocess = PreprocessAlterDistributedObjectStmtFromCoordinator,
.postprocess = NULL, .postprocess = NULL,
.objectType = OBJECT_DOMAIN, .objectType = OBJECT_DOMAIN,
.operationType = DIST_OPS_ALTER, .operationType = DIST_OPS_ALTER,
@ -700,7 +700,7 @@ static DistributeObjectOps ForeignServer_Grant = {
static DistributeObjectOps ForeignServer_Rename = { static DistributeObjectOps ForeignServer_Rename = {
.deparse = DeparseAlterForeignServerRenameStmt, .deparse = DeparseAlterForeignServerRenameStmt,
.qualify = NULL, .qualify = NULL,
.preprocess = PreprocessAlterDistributedObjectStmt, .preprocess = PreprocessAlterDistributedObjectStmtFromCoordinator,
.postprocess = NULL, .postprocess = NULL,
.objectType = OBJECT_FOREIGN_SERVER, .objectType = OBJECT_FOREIGN_SERVER,
.operationType = DIST_OPS_ALTER, .operationType = DIST_OPS_ALTER,
@ -710,8 +710,8 @@ static DistributeObjectOps ForeignServer_Rename = {
static DistributeObjectOps ForeignServer_AlterOwner = { static DistributeObjectOps ForeignServer_AlterOwner = {
.deparse = DeparseAlterForeignServerOwnerStmt, .deparse = DeparseAlterForeignServerOwnerStmt,
.qualify = NULL, .qualify = NULL,
.preprocess = PreprocessAlterDistributedObjectStmt, .preprocess = PreprocessAlterDistributedObjectStmtFromCoordinator,
.postprocess = PostprocessAlterDistributedObjectStmt, .postprocess = PostprocessAlterDistributedObjectStmtFromCoordinator,
.objectType = OBJECT_FOREIGN_SERVER, .objectType = OBJECT_FOREIGN_SERVER,
.operationType = DIST_OPS_ALTER, .operationType = DIST_OPS_ALTER,
.address = AlterForeignServerOwnerStmtObjectAddress, .address = AlterForeignServerOwnerStmtObjectAddress,
@ -738,8 +738,8 @@ static DistributeObjectOps Function_AlterObjectDepends = {
static DistributeObjectOps Function_AlterObjectSchema = { static DistributeObjectOps Function_AlterObjectSchema = {
.deparse = DeparseAlterFunctionSchemaStmt, .deparse = DeparseAlterFunctionSchemaStmt,
.qualify = QualifyAlterFunctionSchemaStmt, .qualify = QualifyAlterFunctionSchemaStmt,
.preprocess = PreprocessAlterDistributedObjectStmt, .preprocess = PreprocessAlterDistributedObjectStmtFromCoordinator,
.postprocess = PostprocessAlterDistributedObjectStmt, .postprocess = PostprocessAlterDistributedObjectStmtFromCoordinator,
.objectType = OBJECT_FUNCTION, .objectType = OBJECT_FUNCTION,
.operationType = DIST_OPS_ALTER, .operationType = DIST_OPS_ALTER,
.address = AlterFunctionSchemaStmtObjectAddress, .address = AlterFunctionSchemaStmtObjectAddress,
@ -748,8 +748,8 @@ static DistributeObjectOps Function_AlterObjectSchema = {
static DistributeObjectOps Function_AlterOwner = { static DistributeObjectOps Function_AlterOwner = {
.deparse = DeparseAlterFunctionOwnerStmt, .deparse = DeparseAlterFunctionOwnerStmt,
.qualify = QualifyAlterFunctionOwnerStmt, .qualify = QualifyAlterFunctionOwnerStmt,
.preprocess = PreprocessAlterDistributedObjectStmt, .preprocess = PreprocessAlterDistributedObjectStmtFromCoordinator,
.postprocess = PostprocessAlterDistributedObjectStmt, .postprocess = PostprocessAlterDistributedObjectStmtFromCoordinator,
.objectType = OBJECT_FUNCTION, .objectType = OBJECT_FUNCTION,
.operationType = DIST_OPS_ALTER, .operationType = DIST_OPS_ALTER,
.address = AlterFunctionOwnerObjectAddress, .address = AlterFunctionOwnerObjectAddress,
@ -785,7 +785,7 @@ static DistributeObjectOps View_Drop = {
static DistributeObjectOps Function_Rename = { static DistributeObjectOps Function_Rename = {
.deparse = DeparseRenameFunctionStmt, .deparse = DeparseRenameFunctionStmt,
.qualify = QualifyRenameFunctionStmt, .qualify = QualifyRenameFunctionStmt,
.preprocess = PreprocessAlterDistributedObjectStmt, .preprocess = PreprocessAlterDistributedObjectStmtFromCoordinator,
.postprocess = NULL, .postprocess = NULL,
.objectType = OBJECT_FUNCTION, .objectType = OBJECT_FUNCTION,
.operationType = DIST_OPS_ALTER, .operationType = DIST_OPS_ALTER,
@ -831,8 +831,8 @@ static DistributeObjectOps Procedure_AlterObjectDepends = {
static DistributeObjectOps Procedure_AlterObjectSchema = { static DistributeObjectOps Procedure_AlterObjectSchema = {
.deparse = DeparseAlterFunctionSchemaStmt, .deparse = DeparseAlterFunctionSchemaStmt,
.qualify = QualifyAlterFunctionSchemaStmt, .qualify = QualifyAlterFunctionSchemaStmt,
.preprocess = PreprocessAlterDistributedObjectStmt, .preprocess = PreprocessAlterDistributedObjectStmtFromCoordinator,
.postprocess = PostprocessAlterDistributedObjectStmt, .postprocess = PostprocessAlterDistributedObjectStmtFromCoordinator,
.objectType = OBJECT_FUNCTION, .objectType = OBJECT_FUNCTION,
.operationType = DIST_OPS_ALTER, .operationType = DIST_OPS_ALTER,
.address = AlterFunctionSchemaStmtObjectAddress, .address = AlterFunctionSchemaStmtObjectAddress,
@ -841,8 +841,8 @@ static DistributeObjectOps Procedure_AlterObjectSchema = {
static DistributeObjectOps Procedure_AlterOwner = { static DistributeObjectOps Procedure_AlterOwner = {
.deparse = DeparseAlterFunctionOwnerStmt, .deparse = DeparseAlterFunctionOwnerStmt,
.qualify = QualifyAlterFunctionOwnerStmt, .qualify = QualifyAlterFunctionOwnerStmt,
.preprocess = PreprocessAlterDistributedObjectStmt, .preprocess = PreprocessAlterDistributedObjectStmtFromCoordinator,
.postprocess = PostprocessAlterDistributedObjectStmt, .postprocess = PostprocessAlterDistributedObjectStmtFromCoordinator,
.objectType = OBJECT_FUNCTION, .objectType = OBJECT_FUNCTION,
.operationType = DIST_OPS_ALTER, .operationType = DIST_OPS_ALTER,
.address = AlterFunctionOwnerObjectAddress, .address = AlterFunctionOwnerObjectAddress,
@ -869,7 +869,7 @@ static DistributeObjectOps Procedure_Grant = {
static DistributeObjectOps Procedure_Rename = { static DistributeObjectOps Procedure_Rename = {
.deparse = DeparseRenameFunctionStmt, .deparse = DeparseRenameFunctionStmt,
.qualify = QualifyRenameFunctionStmt, .qualify = QualifyRenameFunctionStmt,
.preprocess = PreprocessAlterDistributedObjectStmt, .preprocess = PreprocessAlterDistributedObjectStmtFromCoordinator,
.postprocess = NULL, .postprocess = NULL,
.objectType = OBJECT_FUNCTION, .objectType = OBJECT_FUNCTION,
.operationType = DIST_OPS_ALTER, .operationType = DIST_OPS_ALTER,
@ -880,7 +880,7 @@ static DistributeObjectOps Publication_Alter = {
.deparse = DeparseAlterPublicationStmt, .deparse = DeparseAlterPublicationStmt,
.qualify = QualifyAlterPublicationStmt, .qualify = QualifyAlterPublicationStmt,
.preprocess = PreprocessAlterPublicationStmt, .preprocess = PreprocessAlterPublicationStmt,
.postprocess = PostprocessAlterDistributedObjectStmt, .postprocess = PostprocessAlterDistributedObjectStmtFromCoordinator,
.objectType = OBJECT_PUBLICATION, .objectType = OBJECT_PUBLICATION,
.operationType = DIST_OPS_ALTER, .operationType = DIST_OPS_ALTER,
.address = AlterPublicationStmtObjectAddress, .address = AlterPublicationStmtObjectAddress,
@ -889,8 +889,8 @@ static DistributeObjectOps Publication_Alter = {
static DistributeObjectOps Publication_AlterOwner = { static DistributeObjectOps Publication_AlterOwner = {
.deparse = DeparseAlterPublicationOwnerStmt, .deparse = DeparseAlterPublicationOwnerStmt,
.qualify = NULL, .qualify = NULL,
.preprocess = PreprocessAlterDistributedObjectStmt, .preprocess = PreprocessAlterDistributedObjectStmtFromCoordinator,
.postprocess = PostprocessAlterDistributedObjectStmt, .postprocess = PostprocessAlterDistributedObjectStmtFromCoordinator,
.objectType = OBJECT_PUBLICATION, .objectType = OBJECT_PUBLICATION,
.operationType = DIST_OPS_ALTER, .operationType = DIST_OPS_ALTER,
.address = AlterPublicationOwnerStmtObjectAddress, .address = AlterPublicationOwnerStmtObjectAddress,
@ -908,7 +908,7 @@ static DistributeObjectOps Publication_Drop = {
static DistributeObjectOps Publication_Rename = { static DistributeObjectOps Publication_Rename = {
.deparse = DeparseRenamePublicationStmt, .deparse = DeparseRenamePublicationStmt,
.qualify = NULL, .qualify = NULL,
.preprocess = PreprocessAlterDistributedObjectStmt, .preprocess = PreprocessAlterDistributedObjectStmtFromCoordinator,
.postprocess = NULL, .postprocess = NULL,
.objectType = OBJECT_PUBLICATION, .objectType = OBJECT_PUBLICATION,
.operationType = DIST_OPS_ALTER, .operationType = DIST_OPS_ALTER,
@ -990,7 +990,7 @@ static DistributeObjectOps Sequence_Rename = {
static DistributeObjectOps TextSearchConfig_Alter = { static DistributeObjectOps TextSearchConfig_Alter = {
.deparse = DeparseAlterTextSearchConfigurationStmt, .deparse = DeparseAlterTextSearchConfigurationStmt,
.qualify = QualifyAlterTextSearchConfigurationStmt, .qualify = QualifyAlterTextSearchConfigurationStmt,
.preprocess = PreprocessAlterDistributedObjectStmt, .preprocess = PreprocessAlterDistributedObjectStmtFromCoordinator,
.postprocess = NULL, .postprocess = NULL,
.objectType = OBJECT_TSCONFIGURATION, .objectType = OBJECT_TSCONFIGURATION,
.operationType = DIST_OPS_ALTER, .operationType = DIST_OPS_ALTER,
@ -1000,8 +1000,8 @@ static DistributeObjectOps TextSearchConfig_Alter = {
static DistributeObjectOps TextSearchConfig_AlterObjectSchema = { static DistributeObjectOps TextSearchConfig_AlterObjectSchema = {
.deparse = DeparseAlterTextSearchConfigurationSchemaStmt, .deparse = DeparseAlterTextSearchConfigurationSchemaStmt,
.qualify = QualifyAlterTextSearchConfigurationSchemaStmt, .qualify = QualifyAlterTextSearchConfigurationSchemaStmt,
.preprocess = PreprocessAlterDistributedObjectStmt, .preprocess = PreprocessAlterDistributedObjectStmtFromCoordinator,
.postprocess = PostprocessAlterDistributedObjectStmt, .postprocess = PostprocessAlterDistributedObjectStmtFromCoordinator,
.objectType = OBJECT_TSCONFIGURATION, .objectType = OBJECT_TSCONFIGURATION,
.operationType = DIST_OPS_ALTER, .operationType = DIST_OPS_ALTER,
.address = AlterTextSearchConfigurationSchemaStmtObjectAddress, .address = AlterTextSearchConfigurationSchemaStmtObjectAddress,
@ -1010,8 +1010,8 @@ static DistributeObjectOps TextSearchConfig_AlterObjectSchema = {
static DistributeObjectOps TextSearchConfig_AlterOwner = { static DistributeObjectOps TextSearchConfig_AlterOwner = {
.deparse = DeparseAlterTextSearchConfigurationOwnerStmt, .deparse = DeparseAlterTextSearchConfigurationOwnerStmt,
.qualify = QualifyAlterTextSearchConfigurationOwnerStmt, .qualify = QualifyAlterTextSearchConfigurationOwnerStmt,
.preprocess = PreprocessAlterDistributedObjectStmt, .preprocess = PreprocessAlterDistributedObjectStmtFromCoordinator,
.postprocess = PostprocessAlterDistributedObjectStmt, .postprocess = PostprocessAlterDistributedObjectStmtFromCoordinator,
.objectType = OBJECT_TSCONFIGURATION, .objectType = OBJECT_TSCONFIGURATION,
.operationType = DIST_OPS_ALTER, .operationType = DIST_OPS_ALTER,
.address = AlterTextSearchConfigurationOwnerObjectAddress, .address = AlterTextSearchConfigurationOwnerObjectAddress,
@ -1025,7 +1025,7 @@ static DistributeObjectOps TextSearchConfig_Comment = {
* and adress function * and adress function
*/ */
.qualify = QualifyTextSearchConfigurationCommentStmt, .qualify = QualifyTextSearchConfigurationCommentStmt,
.preprocess = PreprocessAlterDistributedObjectStmt, .preprocess = PreprocessAlterDistributedObjectStmtFromCoordinator,
.postprocess = NULL, .postprocess = NULL,
.objectType = OBJECT_TSCONFIGURATION, .objectType = OBJECT_TSCONFIGURATION,
.operationType = DIST_OPS_ALTER, .operationType = DIST_OPS_ALTER,
@ -1054,7 +1054,7 @@ static DistributeObjectOps TextSearchConfig_Drop = {
static DistributeObjectOps TextSearchConfig_Rename = { static DistributeObjectOps TextSearchConfig_Rename = {
.deparse = DeparseRenameTextSearchConfigurationStmt, .deparse = DeparseRenameTextSearchConfigurationStmt,
.qualify = QualifyRenameTextSearchConfigurationStmt, .qualify = QualifyRenameTextSearchConfigurationStmt,
.preprocess = PreprocessAlterDistributedObjectStmt, .preprocess = PreprocessAlterDistributedObjectStmtFromCoordinator,
.postprocess = NULL, .postprocess = NULL,
.objectType = OBJECT_TSCONFIGURATION, .objectType = OBJECT_TSCONFIGURATION,
.operationType = DIST_OPS_ALTER, .operationType = DIST_OPS_ALTER,
@ -1064,7 +1064,7 @@ static DistributeObjectOps TextSearchConfig_Rename = {
static DistributeObjectOps TextSearchDict_Alter = { static DistributeObjectOps TextSearchDict_Alter = {
.deparse = DeparseAlterTextSearchDictionaryStmt, .deparse = DeparseAlterTextSearchDictionaryStmt,
.qualify = QualifyAlterTextSearchDictionaryStmt, .qualify = QualifyAlterTextSearchDictionaryStmt,
.preprocess = PreprocessAlterDistributedObjectStmt, .preprocess = PreprocessAlterDistributedObjectStmtFromCoordinator,
.postprocess = NULL, .postprocess = NULL,
.objectType = OBJECT_TSDICTIONARY, .objectType = OBJECT_TSDICTIONARY,
.operationType = DIST_OPS_ALTER, .operationType = DIST_OPS_ALTER,
@ -1074,8 +1074,8 @@ static DistributeObjectOps TextSearchDict_Alter = {
static DistributeObjectOps TextSearchDict_AlterObjectSchema = { static DistributeObjectOps TextSearchDict_AlterObjectSchema = {
.deparse = DeparseAlterTextSearchDictionarySchemaStmt, .deparse = DeparseAlterTextSearchDictionarySchemaStmt,
.qualify = QualifyAlterTextSearchDictionarySchemaStmt, .qualify = QualifyAlterTextSearchDictionarySchemaStmt,
.preprocess = PreprocessAlterDistributedObjectStmt, .preprocess = PreprocessAlterDistributedObjectStmtFromCoordinator,
.postprocess = PostprocessAlterDistributedObjectStmt, .postprocess = PostprocessAlterDistributedObjectStmtFromCoordinator,
.objectType = OBJECT_TSDICTIONARY, .objectType = OBJECT_TSDICTIONARY,
.operationType = DIST_OPS_ALTER, .operationType = DIST_OPS_ALTER,
.address = AlterTextSearchDictionarySchemaStmtObjectAddress, .address = AlterTextSearchDictionarySchemaStmtObjectAddress,
@ -1084,8 +1084,8 @@ static DistributeObjectOps TextSearchDict_AlterObjectSchema = {
static DistributeObjectOps TextSearchDict_AlterOwner = { static DistributeObjectOps TextSearchDict_AlterOwner = {
.deparse = DeparseAlterTextSearchDictionaryOwnerStmt, .deparse = DeparseAlterTextSearchDictionaryOwnerStmt,
.qualify = QualifyAlterTextSearchDictionaryOwnerStmt, .qualify = QualifyAlterTextSearchDictionaryOwnerStmt,
.preprocess = PreprocessAlterDistributedObjectStmt, .preprocess = PreprocessAlterDistributedObjectStmtFromCoordinator,
.postprocess = PostprocessAlterDistributedObjectStmt, .postprocess = PostprocessAlterDistributedObjectStmtFromCoordinator,
.objectType = OBJECT_TSDICTIONARY, .objectType = OBJECT_TSDICTIONARY,
.operationType = DIST_OPS_ALTER, .operationType = DIST_OPS_ALTER,
.address = AlterTextSearchDictOwnerObjectAddress, .address = AlterTextSearchDictOwnerObjectAddress,
@ -1094,7 +1094,7 @@ static DistributeObjectOps TextSearchDict_AlterOwner = {
static DistributeObjectOps TextSearchDict_Comment = { static DistributeObjectOps TextSearchDict_Comment = {
.deparse = DeparseCommentStmt, .deparse = DeparseCommentStmt,
.qualify = QualifyTextSearchDictionaryCommentStmt, .qualify = QualifyTextSearchDictionaryCommentStmt,
.preprocess = PreprocessAlterDistributedObjectStmt, .preprocess = PreprocessAlterDistributedObjectStmtFromCoordinator,
.postprocess = NULL, .postprocess = NULL,
.objectType = OBJECT_TSDICTIONARY, .objectType = OBJECT_TSDICTIONARY,
.operationType = DIST_OPS_ALTER, .operationType = DIST_OPS_ALTER,
@ -1123,7 +1123,7 @@ static DistributeObjectOps TextSearchDict_Drop = {
static DistributeObjectOps TextSearchDict_Rename = { static DistributeObjectOps TextSearchDict_Rename = {
.deparse = DeparseRenameTextSearchDictionaryStmt, .deparse = DeparseRenameTextSearchDictionaryStmt,
.qualify = QualifyRenameTextSearchDictionaryStmt, .qualify = QualifyRenameTextSearchDictionaryStmt,
.preprocess = PreprocessAlterDistributedObjectStmt, .preprocess = PreprocessAlterDistributedObjectStmtFromCoordinator,
.postprocess = NULL, .postprocess = NULL,
.objectType = OBJECT_TSDICTIONARY, .objectType = OBJECT_TSDICTIONARY,
.operationType = DIST_OPS_ALTER, .operationType = DIST_OPS_ALTER,
@ -1142,8 +1142,8 @@ static DistributeObjectOps Trigger_AlterObjectDepends = {
static DistributeObjectOps Routine_AlterObjectSchema = { static DistributeObjectOps Routine_AlterObjectSchema = {
.deparse = DeparseAlterFunctionSchemaStmt, .deparse = DeparseAlterFunctionSchemaStmt,
.qualify = QualifyAlterFunctionSchemaStmt, .qualify = QualifyAlterFunctionSchemaStmt,
.preprocess = PreprocessAlterDistributedObjectStmt, .preprocess = PreprocessAlterDistributedObjectStmtFromCoordinator,
.postprocess = PostprocessAlterDistributedObjectStmt, .postprocess = PostprocessAlterDistributedObjectStmtFromCoordinator,
.objectType = OBJECT_FUNCTION, .objectType = OBJECT_FUNCTION,
.operationType = DIST_OPS_ALTER, .operationType = DIST_OPS_ALTER,
.address = AlterFunctionSchemaStmtObjectAddress, .address = AlterFunctionSchemaStmtObjectAddress,
@ -1152,8 +1152,8 @@ static DistributeObjectOps Routine_AlterObjectSchema = {
static DistributeObjectOps Routine_AlterOwner = { static DistributeObjectOps Routine_AlterOwner = {
.deparse = DeparseAlterFunctionOwnerStmt, .deparse = DeparseAlterFunctionOwnerStmt,
.qualify = QualifyAlterFunctionOwnerStmt, .qualify = QualifyAlterFunctionOwnerStmt,
.preprocess = PreprocessAlterDistributedObjectStmt, .preprocess = PreprocessAlterDistributedObjectStmtFromCoordinator,
.postprocess = PostprocessAlterDistributedObjectStmt, .postprocess = PostprocessAlterDistributedObjectStmtFromCoordinator,
.objectType = OBJECT_FUNCTION, .objectType = OBJECT_FUNCTION,
.operationType = DIST_OPS_ALTER, .operationType = DIST_OPS_ALTER,
.address = AlterFunctionOwnerObjectAddress, .address = AlterFunctionOwnerObjectAddress,
@ -1180,7 +1180,7 @@ static DistributeObjectOps Routine_Grant = {
static DistributeObjectOps Routine_Rename = { static DistributeObjectOps Routine_Rename = {
.deparse = DeparseRenameFunctionStmt, .deparse = DeparseRenameFunctionStmt,
.qualify = QualifyRenameFunctionStmt, .qualify = QualifyRenameFunctionStmt,
.preprocess = PreprocessAlterDistributedObjectStmt, .preprocess = PreprocessAlterDistributedObjectStmtFromCoordinator,
.postprocess = NULL, .postprocess = NULL,
.objectType = OBJECT_FUNCTION, .objectType = OBJECT_FUNCTION,
.operationType = DIST_OPS_ALTER, .operationType = DIST_OPS_ALTER,
@ -1190,7 +1190,7 @@ static DistributeObjectOps Routine_Rename = {
static DistributeObjectOps Schema_AlterOwner = { static DistributeObjectOps Schema_AlterOwner = {
.deparse = DeparseAlterSchemaOwnerStmt, .deparse = DeparseAlterSchemaOwnerStmt,
.qualify = NULL, .qualify = NULL,
.preprocess = PreprocessAlterDistributedObjectStmt, .preprocess = PreprocessAlterDistributedObjectStmtFromCoordinator,
.operationType = DIST_OPS_ALTER, .operationType = DIST_OPS_ALTER,
.postprocess = NULL, .postprocess = NULL,
.address = AlterSchemaOwnerStmtObjectAddress, .address = AlterSchemaOwnerStmtObjectAddress,
@ -1217,7 +1217,7 @@ static DistributeObjectOps Schema_Grant = {
static DistributeObjectOps Schema_Rename = { static DistributeObjectOps Schema_Rename = {
.deparse = DeparseAlterSchemaRenameStmt, .deparse = DeparseAlterSchemaRenameStmt,
.qualify = NULL, .qualify = NULL,
.preprocess = PreprocessAlterDistributedObjectStmt, .preprocess = PreprocessAlterDistributedObjectStmtFromCoordinator,
.postprocess = NULL, .postprocess = NULL,
.objectType = OBJECT_SCHEMA, .objectType = OBJECT_SCHEMA,
.operationType = DIST_OPS_ALTER, .operationType = DIST_OPS_ALTER,
@ -1299,8 +1299,8 @@ static DistributeObjectOps Table_Drop = {
static DistributeObjectOps Type_AlterObjectSchema = { static DistributeObjectOps Type_AlterObjectSchema = {
.deparse = DeparseAlterTypeSchemaStmt, .deparse = DeparseAlterTypeSchemaStmt,
.qualify = QualifyAlterTypeSchemaStmt, .qualify = QualifyAlterTypeSchemaStmt,
.preprocess = PreprocessAlterDistributedObjectStmt, .preprocess = PreprocessAlterDistributedObjectStmtFromCoordinator,
.postprocess = PostprocessAlterDistributedObjectStmt, .postprocess = PostprocessAlterDistributedObjectStmtFromCoordinator,
.objectType = OBJECT_TYPE, .objectType = OBJECT_TYPE,
.operationType = DIST_OPS_ALTER, .operationType = DIST_OPS_ALTER,
.address = AlterTypeSchemaStmtObjectAddress, .address = AlterTypeSchemaStmtObjectAddress,
@ -1326,8 +1326,8 @@ static DistributeObjectOps View_AlterObjectSchema = {
static DistributeObjectOps Type_AlterOwner = { static DistributeObjectOps Type_AlterOwner = {
.deparse = DeparseAlterTypeOwnerStmt, .deparse = DeparseAlterTypeOwnerStmt,
.qualify = QualifyAlterTypeOwnerStmt, .qualify = QualifyAlterTypeOwnerStmt,
.preprocess = PreprocessAlterDistributedObjectStmt, .preprocess = PreprocessAlterDistributedObjectStmtFromCoordinator,
.postprocess = PostprocessAlterDistributedObjectStmt, .postprocess = PostprocessAlterDistributedObjectStmtFromCoordinator,
.objectType = OBJECT_TYPE, .objectType = OBJECT_TYPE,
.operationType = DIST_OPS_ALTER, .operationType = DIST_OPS_ALTER,
.address = AlterTypeOwnerObjectAddress, .address = AlterTypeOwnerObjectAddress,
@ -1336,7 +1336,7 @@ static DistributeObjectOps Type_AlterOwner = {
static DistributeObjectOps Type_AlterTable = { static DistributeObjectOps Type_AlterTable = {
.deparse = DeparseAlterTypeStmt, .deparse = DeparseAlterTypeStmt,
.qualify = QualifyAlterTypeStmt, .qualify = QualifyAlterTypeStmt,
.preprocess = PreprocessAlterDistributedObjectStmt, .preprocess = PreprocessAlterDistributedObjectStmtFromCoordinator,
.postprocess = NULL, .postprocess = NULL,
.objectType = OBJECT_TYPE, .objectType = OBJECT_TYPE,
.operationType = DIST_OPS_ALTER, .operationType = DIST_OPS_ALTER,
@ -1381,7 +1381,7 @@ static DistributeObjectOps Trigger_Drop = {
static DistributeObjectOps Type_Rename = { static DistributeObjectOps Type_Rename = {
.deparse = DeparseRenameTypeStmt, .deparse = DeparseRenameTypeStmt,
.qualify = QualifyRenameTypeStmt, .qualify = QualifyRenameTypeStmt,
.preprocess = PreprocessAlterDistributedObjectStmt, .preprocess = PreprocessAlterDistributedObjectStmtFromCoordinator,
.postprocess = NULL, .postprocess = NULL,
.objectType = OBJECT_TYPE, .objectType = OBJECT_TYPE,
.operationType = DIST_OPS_ALTER, .operationType = DIST_OPS_ALTER,

View File

@ -336,8 +336,8 @@ BuildPublicationRelationObjSpec(Oid relationId, Oid publicationId,
/* /*
* PreprocessAlterPublicationStmt handles ALTER PUBLICATION statements * PreprocessAlterPublicationStmt handles ALTER PUBLICATION statements in a way
* in a way that is mostly similar to PreprocessAlterDistributedObjectStmt, * that is mostly similar to PreprocessAlterDistributedObjectStmtFromCoordinator,
* except we do not ensure sequential mode (publications do not interact with * except we do not ensure sequential mode (publications do not interact with
* shards) and can handle NULL deparse commands for ALTER PUBLICATION commands * shards) and can handle NULL deparse commands for ALTER PUBLICATION commands
* that only involve local tables. * that only involve local tables.

View File

@ -187,10 +187,12 @@ extern List * PreprocessClusterStmt(Node *node, const char *clusterCommand,
/* common.c - forward declarations*/ /* common.c - forward declarations*/
extern List * PostprocessCreateDistributedObjectFromCatalogStmt(Node *stmt, extern List * PostprocessCreateDistributedObjectFromCatalogStmt(Node *stmt,
const char *queryString); const char *queryString);
extern List * PreprocessAlterDistributedObjectStmt(Node *stmt, const char *queryString, extern List * PreprocessAlterDistributedObjectStmtFromCoordinator(Node *stmt,
const char *queryString,
ProcessUtilityContext ProcessUtilityContext
processUtilityContext); processUtilityContext);
extern List * PostprocessAlterDistributedObjectStmt(Node *stmt, const char *queryString); extern List * PostprocessAlterDistributedObjectStmtFromCoordinator(Node *stmt,
const char *queryString);
extern List * PreprocessDropDistributedObjectStmt(Node *node, const char *queryString, extern List * PreprocessDropDistributedObjectStmt(Node *node, const char *queryString,
ProcessUtilityContext ProcessUtilityContext
processUtilityContext); processUtilityContext);