Do not error out if transaction type is INTERNALOID for aggregates
authorPavan Deolasee <[email protected]>
Wed, 1 Jul 2015 07:36:00 +0000 (13:06 +0530)
committerPavan Deolasee <[email protected]>
Wed, 1 Jul 2015 07:36:00 +0000 (13:06 +0530)
Its not clear why this was added in the original commit. Neither the commit
message nor the code has any comment explaining this. Moreover as clear from
the regression tests, we do support transaction types as INTERNALOID. Sure
aggregates can't support 2-step aggregation for internal types because the
transition function result needs to be sent to the coordinator for collection.
But that's a separate patch, if at all needed

src/backend/catalog/pg_aggregate.c

index 723b82e2d474f366ed91beafbd35999f369b453e..51de82be6493f7256b6733369e04e01bc53dfc6d 100644 (file)
@@ -138,13 +138,14 @@ AggregateCreate(const char *aggName,
                                                           FUNC_MAX_ARGS - 1)));
 
 #ifdef PGXC
+#ifndef XCP
 
        if (aggTransType == INTERNALOID)
                ereport(ERROR,
                                (errcode(ERRCODE_INVALID_FUNCTION_DEFINITION),
                                 errmsg("unsafe use of pseudo-type \"internal\""),
                                 errdetail("Transition type can not be \"internal\".")));
-
+#endif
 #endif
        /* check for polymorphic and INTERNAL arguments */
        hasPolyArg = false;