59{
99
100
102
103
108
109
110 if (!oldstyle)
111 {
116 else
119 }
120
121
122 foreach(
pl, parameters)
123 {
125
126
127
128
129
136 else if (
strcmp(
defel->defname,
"combinefunc") == 0)
138 else if (
strcmp(
defel->defname,
"serialfunc") == 0)
140 else if (
strcmp(
defel->defname,
"deserialfunc") == 0)
146 else if (
strcmp(
defel->defname,
"mfinalfunc") == 0)
148 else if (
strcmp(
defel->defname,
"finalfunc_extra") == 0)
150 else if (
strcmp(
defel->defname,
"mfinalfunc_extra") == 0)
152 else if (
strcmp(
defel->defname,
"finalfunc_modify") == 0)
154 else if (
strcmp(
defel->defname,
"mfinalfunc_modify") == 0)
160 else if (
strcmp(
defel->defname,
"hypothetical") == 0)
161 {
163 {
167 errmsg(
"only ordered-set aggregates can be hypothetical")));
169 }
170 }
189 else
192 errmsg(
"aggregate attribute \"%s\" not recognized",
194 }
195
196
197
198
202 errmsg(
"aggregate stype must be specified")));
206 errmsg(
"aggregate sfunc must be specified")));
207
208
209
210
211
212
214 {
218 errmsg(
"aggregate msfunc must be specified when mstype is specified")));
222 errmsg(
"aggregate minvfunc must be specified when mstype is specified")));
223 }
224 else
225 {
229 errmsg(
"aggregate msfunc must not be specified without mstype")));
233 errmsg(
"aggregate minvfunc must not be specified without mstype")));
237 errmsg(
"aggregate mfinalfunc must not be specified without mstype")));
241 errmsg(
"aggregate msspace must not be specified without mstype")));
245 errmsg(
"aggregate minitcond must not be specified without mstype")));
246 }
247
248
249
250
251
256
257
258
259
260 if (oldstyle)
261 {
262
263
264
265
266
267
268
270
271 if (baseType ==
NULL)
274 errmsg(
"aggregate input type must be specified")));
275
277 {
280 }
281 else
282 {
285 }
292 }
293 else
294 {
295
296
297
298
300
301 if (baseType !=
NULL)
304 errmsg(
"basetype is redundant with aggregate input type specification")));
305
308 args,
311 ¶meterTypes,
320
322
324 }
325
326
327
328
329
330
331
332
333
334
335
336
341 {
343 ;
344 else
347 errmsg(
"aggregate transition data type cannot be %s",
349 }
350
352 {
353
354
355
359 errmsg(
"serialization functions may be specified only when the aggregate transition data type is %s",
361 }
363 {
364
365
366
369 errmsg(
"must specify both or neither of serialization and deserialization functions")));
370 }
371
372
373
374
375
377 {
382 {
384 ;
385 else
388 errmsg(
"aggregate transition data type cannot be %s",
390 }
391 }
392
393
394
395
396
397
398
399
400
401
403 {
405 typioparam;
406
409 }
410
411
412
413
415 {
417 typioparam;
418
421 }
422
424 {
431 else
434 errmsg(
"parameter \"parallel\" must be SAFE, RESTRICTED, or UNSAFE")));
435 }
436
437
438
439
442 replace,
446 parameterTypes,
472}
void aclcheck_error(AclResult aclerr, ObjectType objtype, const char *objectname)
AclResult object_aclcheck(Oid classid, Oid objectid, Oid roleid, AclMode mode)
static char extractModify(DefElem *defel)
#define Assert(condition)
TypeName * defGetTypeName(DefElem *def)
int32 defGetInt32(DefElem *def)
char * defGetString(DefElem *def)
bool defGetBoolean(DefElem *def)
List * defGetQualifiedName(DefElem *def)
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
#define ereport(elevel,...)
Datum OidInputFunctionCall(Oid functionId, char *str, Oid typioparam, int32 typmod)
void interpret_function_parameter_list(ParseState *pstate, List *parameters, Oid languageOid, ObjectType objtype, oidvector **parameterTypes, List **parameterTypes_list, ArrayType **allParameterTypes, ArrayType **parameterModes, ArrayType **parameterNames, List **inParameterNames_list, List **parameterDefaults, Oid *variadicArgType, Oid *requiredResultType)
void getTypeInputInfo(Oid type, Oid *typInput, Oid *typIOParam)
char get_typtype(Oid typid)
char * get_namespace_name(Oid nspid)
Oid QualifiedNameGetCreationNamespace(const List *names, char **objname_p)
oidvector * buildoidvector(const Oid *oids, int n)
char * TypeNameToString(const TypeName *typeName)
Oid typenameTypeId(ParseState *pstate, const TypeName *typeName)
ObjectAddress AggregateCreate(const char *aggName, Oid aggNamespace, bool replace, char aggKind, int numArgs, int numDirectArgs, oidvector *parameterTypes, Datum allParameterTypes, Datum parameterModes, Datum parameterNames, List *parameterDefaults, Oid variadicArgType, List *aggtransfnName, List *aggfinalfnName, List *aggcombinefnName, List *aggserialfnName, List *aggdeserialfnName, List *aggmtransfnName, List *aggminvtransfnName, List *aggmfinalfnName, bool finalfnExtraArgs, bool mfinalfnExtraArgs, char finalfnModify, char mfinalfnModify, List *aggsortopName, Oid aggTransType, int32 aggTransSpace, Oid aggmTransType, int32 aggmTransSpace, const char *agginitval, const char *aggminitval, char proparallel)
#define lfirst_node(type, lc)
static int list_length(const List *l)
#define linitial_node(type, l)
int pg_strcasecmp(const char *s1, const char *s2)
static Datum PointerGetDatum(const void *X)