78{
104 char *detailmsg;
110
111
113 elog(
ERROR,
"no aggregate name supplied");
114
116 elog(
ERROR,
"aggregate must have a transition function");
117
119 elog(
ERROR,
"incorrect number of direct arguments for aggregate");
120
121
122
123
124
125
129 errmsg_plural(
"aggregates cannot have more than %d argument",
130 "aggregates cannot have more than %d arguments",
133
134
135
136
137
141 if (detailmsg)
144 errmsg(
"cannot determine transition data type"),
146
147
148
149
151 {
155 if (detailmsg)
158 errmsg(
"cannot determine transition data type"),
160 }
161
162
163
164
165
166
167
168
173 errmsg(
"a variadic ordered-set aggregate must use VARIADIC type ANY")));
174
175
176
177
178
179
180
181
182
183
184
185
186
189 {
191
199 errmsg(
"a hypothetical-set aggregate must have direct arguments matching its aggregated arguments")));
200 }
201
202
203
204
205
206
207
208
210 {
213 else
214 {
215
218 }
222 }
223 else
224 {
228 }
231 &rettype);
232
233
234
235
236
237
238
239
240
241
242
246 errmsg(
"return type of transition function %s is not %s",
249
252 elog(
ERROR,
"cache lookup failed for function %u", transfn);
254
255
256
257
258
259
261 {
266 errmsg(
"must not omit initial value when transition function is strict and transition type is not compatible with input type")));
267 }
268
270
271
273 {
274
275
276
277
278
281
284 &rettype);
285
286
290 errmsg(
"return type of transition function %s is not %s",
293
298
299
300
301
302
304 {
309 errmsg(
"must not omit initial value when transition function is strict and transition type is not compatible with input type")));
310 }
311
312
314
316 }
317
318
320 {
321
322
323
324
326
329 &rettype);
330
331
335 errmsg(
"return type of inverse transition function %s is not %s",
338
343
344
345
346
347
348
352 errmsg(
"strictness of aggregate's forward and inverse transition functions must match")));
353
355 }
356
357
359 {
360
361
362
363
364
365
366
368
373 else
374 {
377 {
378
380 }
381 }
382
386
387
388
389
390
391
392
396 errmsg(
"final function with extra arguments must not be declared STRICT")));
397 }
398 else
399 {
400
401
402
404 }
406
407
409 {
411
412
413
414
415
418
422
423
427 errmsg(
"return type of combine function %s is not %s",
430
431
432
433
434
435
439 errmsg(
"combine function with transition type %s must not be declared STRICT",
441 }
442
443
444
445
447 {
448
450
453 &rettype);
454
458 errmsg(
"return type of serialization function %s is not %s",
461 }
462
463
464
465
467 {
468
471
474 &rettype);
475
479 errmsg(
"return type of deserialization function %s is not %s",
482 }
483
484
485
486
487
488
489
490
491
495 if (detailmsg)
498 errmsg(
"cannot determine result data type"),
500
501
502
503
504
505
506
510 if (detailmsg)
513 errmsg(
"unsafe use of pseudo-type \"internal\""),
515
516
517
518
519
520
522 {
523
525 {
526
527
528
529
531
536 else
537 {
540 {
541
543 }
544 }
545
548 &rettype);
549
550
554 errmsg(
"final function with extra arguments must not be declared STRICT")));
555 }
556 else
557 {
558
559
560
562 }
567 errmsg(
"moving-aggregate implementation returns type %s, but plain implementation returns type %s",
570 }
571
572
574 {
578 errmsg(
"sort operator can only be specified for single-argument aggregates")));
581 false, -1);
582 }
583
584
585
586
588 {
592 }
593
597
599 {
603 }
604
608
609
610
611
612
613
614
617 replace,
618 false,
623 "aggregate_dummy",
627 false,
628
629 false,
630 false,
632
634 parameterTypes,
643 1,
644 0);
646
647
648
649
652
653
655 {
659 }
682 else
686 else
688
689 if (replace)
691 else
693
695 {
697
698
699
700
701
702
703
707 errmsg(
"cannot change routine kind"),
714 0)));
718 errmsg(
"cannot change number of direct arguments of an aggregate function")));
719
723
727 }
728 else
729 {
732 }
733
735
736
737
738
739
740
741
742
743
744
745
746
748
749
752
753
755 {
758 }
759
760
762 {
765 }
766
767
769 {
772 }
773
774
776 {
779 }
780
781
783 {
786 }
787
788
790 {
793 }
794
795
797 {
800 }
801
802
804 {
807 }
808
812}
AclResult object_aclcheck(Oid classid, Oid objectid, Oid roleid, AclMode mode)
void aclcheck_error_type(AclResult aclerr, Oid typeOid)
static Datum values[MAXATTR]
#define CStringGetTextDatum(s)
#define Assert(condition)
#define OidIsValid(objectId)
void record_object_address_dependencies(const ObjectAddress *depender, ObjectAddresses *referenced, DependencyType behavior)
void add_exact_object_address(const ObjectAddress *object, ObjectAddresses *addrs)
ObjectAddresses * new_object_addresses(void)
void free_object_addresses(ObjectAddresses *addrs)
int errmsg_plural(const char *fmt_singular, const char *fmt_plural, unsigned long n,...)
int errdetail_internal(const char *fmt,...)
int errdetail(const char *fmt,...)
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
#define ereport(elevel,...)
HeapTuple heap_modify_tuple(HeapTuple tuple, TupleDesc tupleDesc, const Datum *replValues, const bool *replIsnull, const bool *doReplace)
HeapTuple heap_form_tuple(TupleDesc tupleDescriptor, const Datum *values, const bool *isnull)
#define HeapTupleIsValid(tuple)
static void * GETSTRUCT(const HeapTupleData *tuple)
void CatalogTupleUpdate(Relation heapRel, const ItemPointerData *otid, HeapTuple tup)
void CatalogTupleInsert(Relation heapRel, HeapTuple tup)
bool func_strict(Oid funcid)
char * NameListToString(const List *names)
#define ObjectAddressSet(addr, class_id, object_id)
char * check_valid_internal_signature(Oid ret_type, const Oid *declared_arg_types, int nargs)
char * check_valid_polymorphic_signature(Oid ret_type, const Oid *declared_arg_types, int nargs)
bool IsBinaryCoercible(Oid srctype, Oid targettype)
Oid LookupOperName(ParseState *pstate, List *opername, Oid oprleft, Oid oprright, bool noError, int location)
static Oid lookup_agg_function(List *fnName, int nargs, Oid *input_types, Oid variadicArgType, Oid *rettype)
FormData_pg_aggregate * Form_pg_aggregate
ObjectAddress ProcedureCreate(const char *procedureName, Oid procNamespace, bool replace, bool returnsSet, Oid returnType, Oid proowner, Oid languageObjectId, Oid languageValidator, const char *prosrc, const char *probin, Node *prosqlbody, char prokind, bool security_definer, bool isLeakProof, bool isStrict, char volatility, char parallel, oidvector *parameterTypes, Datum allParameterTypes, Datum parameterModes, Datum parameterNames, List *parameterDefaults, Datum trftypes, List *trfoids, Datum proconfig, Oid prosupport, float4 procost, float4 prorows)
FormData_pg_proc * Form_pg_proc
static Datum PointerGetDatum(const void *X)
static Datum Int16GetDatum(int16 X)
static Datum BoolGetDatum(bool X)
static Datum ObjectIdGetDatum(Oid X)
static Datum Int32GetDatum(int32 X)
static Datum CharGetDatum(char X)
Oid values[FLEXIBLE_ARRAY_MEMBER]
void ReleaseSysCache(HeapTuple tuple)
HeapTuple SearchSysCache1(int cacheId, Datum key1)
void table_close(Relation relation, LOCKMODE lockmode)
Relation table_open(Oid relationId, LOCKMODE lockmode)