1 /*-------------------------------------------------------------------------
7 * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
8 * Portions Copyright (c) 1994, Regents of the University of California
10 * src/include/parser/parse_func.h
12 *-------------------------------------------------------------------------
17 #include "catalog/namespace.h"
18 #include "parser/parse_node.h"
21 /* Result codes for func_get_detail */
24 FUNCDETAIL_NOTFOUND, /* no matching function */
25 FUNCDETAIL_MULTIPLE, /* too many matching functions */
26 FUNCDETAIL_NORMAL, /* found a matching regular function */
27 FUNCDETAIL_AGGREGATE, /* found a matching aggregate function */
28 FUNCDETAIL_WINDOWFUNC, /* found a matching window function */
29 FUNCDETAIL_COERCION /* it's a type coercion request */
33 extern Node *ParseFuncOrColumn(ParseState *pstate, List *funcname, List *fargs,
34 Node *last_srf, FuncCall *fn, int location);
36 extern FuncDetailCode func_get_detail(List *funcname,
37 List *fargs, List *fargnames,
38 int nargs, Oid *argtypes,
39 bool expand_variadic, bool expand_defaults,
40 Oid *funcid, Oid *rettype,
41 bool *retset, int *nvargs, Oid *vatype,
42 Oid **true_typeids, List **argdefaults);
44 extern int func_match_argtypes(int nargs,
46 FuncCandidateList raw_candidates,
47 FuncCandidateList *candidates);
49 extern FuncCandidateList func_select_candidate(int nargs,
51 FuncCandidateList candidates);
53 extern void make_fn_arguments(ParseState *pstate,
55 Oid *actual_arg_types,
56 Oid *declared_arg_types);
58 extern const char *funcname_signature_string(const char *funcname, int nargs,
59 List *argnames, const Oid *argtypes);
60 extern const char *func_signature_string(List *funcname, int nargs,
61 List *argnames, const Oid *argtypes);
63 extern Oid LookupFuncName(List *funcname, int nargs, const Oid *argtypes,
65 extern Oid LookupFuncWithArgs(ObjectWithArgs *func,
67 extern Oid LookupAggWithArgs(ObjectWithArgs *agg,
70 extern void check_srf_call_placement(ParseState *pstate, Node *last_srf,
73 #endif /* PARSE_FUNC_H */