Fix ALTER EXTENSION ADD/DROP don't be executed on QE
The operation for ALTER EXTENSION ADD/DROP doesn't be dispatched to
segments, so there is no effect on segment.
Now we do it like ExecAlterObjectSchemaStmt() in this commit.
@@ -2981,15 +2981,15 @@ ApplyExtensionUpdates(Oid extensionOid,
}
/*
- * Execute ALTER EXTENSION ADD/DROP
+ * Execute ALTER EXTENSION ADD/DROP on QD or QE.
*
* Return value is the address of the altered extension.
*
* objAddr is an output argument which, if not NULL, is set to the address of
* the added/dropped object.
*/
-ObjectAddress
-ExecAlterExtensionContentsStmt(AlterExtensionContentsStmt *stmt,
+static ObjectAddress
+ExecAlterExtensionContentsStmt_internal(AlterExtensionContentsStmt *stmt,
ObjectAddress *objAddr)
{
ObjectAddress extension;
@@ -3100,6 +3100,26 @@ ExecAlterExtensionContentsStmt(AlterExtensionContentsStmt *stmt,
return extension;
}
+ObjectAddress
+ExecAlterExtensionContentsStmt(AlterExtensionContentsStmt *stmt,
+ ObjectAddress *objAddr)
+{
+ ObjectAddress result;
+ result = ExecAlterExtensionContentsStmt_internal(stmt, objAddr);
+
+ if (Gp_role == GP_ROLE_DISPATCH)
+ {
+ CdbDispatchUtilityStatement((Node *) stmt,
+ DF_CANCEL_ON_ERROR|
+ DF_WITH_SNAPSHOT|
+ DF_NEED_TWO_PHASE,
+ NIL,
+ NULL);
+ }
+
+ return result;
+}
+
/*
* Read the whole of file into memory.
*
