[SQL]allow to use aggregate

This commit is contained in:
chenlinfeng
2020-08-15 21:01:23 +08:00
parent 3eade03f9c
commit 8cd77e1b56
3 changed files with 8 additions and 6 deletions

View File

@ -3795,12 +3795,12 @@ void standard_ProcessUtility(Node* parse_tree, const char* query_string, ParamLi
switch (stmt->kind) {
case OBJECT_AGGREGATE:
#ifdef PGXC
#ifdef ENABLE_MULTIPLE_NODES
if (!u_sess->attr.attr_common.IsInplaceUpgrade && !u_sess->exec_cxt.extension_is_valid)
ereport(ERROR,
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
errmsg("user defined aggregate is not yet supported.")));
#endif /* PGXC */
#endif /* ENABLE_MULTIPLE_NODES */
DefineAggregate(stmt->defnames, stmt->args, stmt->oldstyle, stmt->definition);
break;
case OBJECT_OPERATOR:
@ -8547,9 +8547,11 @@ void CheckObjectInBlackList(ObjectType obj_type, const char* query_string)
return;
else
break;
#ifdef ENABLE_MULTIPLE_NODES
case OBJECT_AGGREGATE:
tag = "AGGREGATE";
break;
#endif
case OBJECT_OPERATOR:
tag = "OPERATOR";
break;

View File

@ -126,12 +126,12 @@ create aggregate newavg2 (sfunc = int4pl,
stype = int4,
finalfunc = int2um,
initcond = '0');
ERROR: user defined aggregate is not yet supported.
ERROR: function int2um(smallint) requires run-time type coercion
-- left out basetype
create aggregate newcnt1 (sfunc = int4inc,
stype = int4,
initcond = '0');
ERROR: user defined aggregate is not yet supported.
ERROR: aggregate input type must be specified
--
-- DROP INDEX
-- missing index name

View File

@ -127,12 +127,12 @@ create aggregate newavg2 (sfunc = int4pl,
stype = int4,
finalfunc = int2um,
initcond = '0');
ERROR: user defined aggregate is not yet supported.
ERROR: function int2um(smallint) requires run-time type coercion
-- left out basetype
create aggregate newcnt1 (sfunc = int4inc,
stype = int4,
initcond = '0');
ERROR: user defined aggregate is not yet supported.
ERROR: aggregate input type must be specified
--
-- DROP INDEX
-- missing index name