113 elog(
ERROR,
"no aggregate name supplied");
116 elog(
ERROR,
"aggregate must have a transition function");
119 elog(
ERROR,
"incorrect number of direct arguments for aggregate");
129 errmsg_plural(
"aggregates cannot have more than %d argument",
130 "aggregates cannot have more than %d arguments",
144 errmsg(
"cannot determine transition data type"),
158 errmsg(
"cannot determine transition data type"),
173 errmsg(
"a variadic ordered-set aggregate must use VARIADIC type ANY")));
199 errmsg(
"a hypothetical-set aggregate must have direct arguments matching its aggregated arguments")));
246 errmsg(
"return type of transition function %s is not %s",
252 elog(
ERROR,
"cache lookup failed for function %u", transfn);
266 errmsg(
"must not omit initial value when transition function is strict and transition type is not compatible with input type")));
290 errmsg(
"return type of transition function %s is not %s",
309 errmsg(
"must not omit initial value when transition function is strict and transition type is not compatible with input type")));
335 errmsg(
"return type of inverse transition function %s is not %s",
352 errmsg(
"strictness of aggregate's forward and inverse transition functions must match")));
396 errmsg(
"final function with extra arguments must not be declared STRICT")));
427 errmsg(
"return type of combine function %s is not %s",
439 errmsg(
"combine function with transition type %s must not be declared STRICT",
458 errmsg(
"return type of serialization function %s is not %s",
479 errmsg(
"return type of deserialization function %s is not %s",
498 errmsg(
"cannot determine result data type"),
513 errmsg(
"unsafe use of pseudo-type \"internal\""),
554 errmsg(
"final function with extra arguments must not be declared STRICT")));
567 errmsg(
"moving-aggregate implementation returns type %s, but plain implementation returns type %s",
578 errmsg(
"sort operator can only be specified for single-argument aggregates")));
707 errmsg(
"cannot change routine kind"),
718 errmsg(
"cannot change number of direct arguments of an aggregate function")));
853 &
fnOid, rettype, &retset,
861 errmsg(
"function %s does not exist",
867 errmsg(
"function %s returns a set",
882 errmsg(
"function %s must accept VARIADIC ANY to be used in this aggregate",
901 for (
i = 0;
i < nargs;
i++)
906 errmsg(
"function %s requires run-time type coercion",
void aclcheck_error(AclResult aclerr, ObjectType objtype, const char *objectname)
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 * get_func_name(Oid funcid)
char * NameListToString(const List *names)
#define ObjectAddressSet(addr, class_id, object_id)
Oid enforce_generic_type_consistency(const Oid *actual_arg_types, Oid *declared_arg_types, int nargs, Oid rettype, bool allow_poly)
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)
FuncDetailCode func_get_detail(List *funcname, List *fargs, List *fargnames, int nargs, Oid *argtypes, bool expand_variadic, bool expand_defaults, bool include_out_arguments, int *fgc_flags, Oid *funcid, Oid *rettype, bool *retset, int *nvargs, Oid *vatype, Oid **true_typeids, List **argdefaults)
const char * func_signature_string(List *funcname, int nargs, List *argnames, const Oid *argtypes)
Oid LookupOperName(ParseState *pstate, List *opername, Oid oprleft, Oid oprright, bool noError, int location)
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)
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)