MCPcopy Create free account
hub / github.com/apache/cloudberry / AggregateCreate

Function AggregateCreate

src/backend/catalog/pg_aggregate.c:46–817  ·  view source on GitHub ↗

* AggregateCreate */

Source from the content-addressed store, hash-verified

44 * AggregateCreate
45 */
46ObjectAddress
47AggregateCreate(const char *aggName,
48 Oid aggNamespace,
49 bool replace,
50 char aggKind,
51 int numArgs,
52 int numDirectArgs,
53 oidvector *parameterTypes,
54 Datum allParameterTypes,
55 Datum parameterModes,
56 Datum parameterNames,
57 List *parameterDefaults,
58 Oid variadicArgType,
59 List *aggtransfnName,
60 List *aggfinalfnName,
61 List *aggcombinefnName,
62 List *aggserialfnName,
63 List *aggdeserialfnName,
64 List *aggmtransfnName,
65 List *aggminvtransfnName,
66 List *aggmfinalfnName,
67 bool finalfnExtraArgs,
68 bool mfinalfnExtraArgs,
69 char finalfnModify,
70 char mfinalfnModify,
71 List *aggsortopName,
72 Oid aggTransType,
73 int32 aggTransSpace,
74 Oid aggmTransType,
75 int32 aggmTransSpace,
76 const char *agginitval,
77 const char *aggminitval,
78 bool aggrepsafeexec,
79 char proparallel)
80{
81 Relation aggdesc;
82 HeapTuple tup;
83 HeapTuple oldtup;
84 bool nulls[Natts_pg_aggregate];
85 Datum values[Natts_pg_aggregate];
86 bool replaces[Natts_pg_aggregate];
87 Form_pg_proc proc;
88 Oid transfn;
89 Oid finalfn = InvalidOid; /* can be omitted */
90 Oid combinefn = InvalidOid; /* can be omitted */
91 Oid serialfn = InvalidOid; /* can be omitted */
92 Oid deserialfn = InvalidOid; /* can be omitted */
93 Oid mtransfn = InvalidOid; /* can be omitted */
94 Oid minvtransfn = InvalidOid; /* can be omitted */
95 Oid mfinalfn = InvalidOid; /* can be omitted */
96 Oid sortop = InvalidOid; /* can be omitted */
97 Oid *aggArgTypes = parameterTypes->values;
98 bool mtransIsStrict = false;
99 Oid rettype;
100 Oid finaltype;
101 Oid fnArgs[FUNC_MAX_ARGS];
102 int nargs_transfn;
103 int nargs_finalfn;

Callers 1

DefineAggregateFunction · 0.85

Calls 15

lookup_agg_functionFunction · 0.85
NameListToStringFunction · 0.85
format_type_beFunction · 0.85
SearchSysCache1Function · 0.85
ObjectIdGetDatumFunction · 0.85
IsBinaryCoercibleFunction · 0.85
ReleaseSysCacheFunction · 0.85
func_strictFunction · 0.85
LookupOperNameFunction · 0.85
pg_type_aclcheckFunction · 0.85

Tested by

no test coverage detected