Fix set_append_rel_pathlist() to deal intelligently with cases where
[PostgreSQL.git] / src / include / parser / parse_func.h
blob2a49f00cbcf4c386f3f57bb9480d134199c260e2
1 /*-------------------------------------------------------------------------
3 * parse_func.h
7 * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
8 * Portions Copyright (c) 1994, Regents of the University of California
10 * $PostgreSQL$
12 *-------------------------------------------------------------------------
14 #ifndef PARSER_FUNC_H
15 #define PARSER_FUNC_H
17 #include "catalog/namespace.h"
18 #include "parser/parse_node.h"
22 * This structure is used to explore the inheritance hierarchy above
23 * nodes in the type tree in order to disambiguate among polymorphic
24 * functions.
26 typedef struct _InhPaths
28 int nsupers; /* number of superclasses */
29 Oid self; /* this class */
30 Oid *supervec; /* vector of superclasses */
31 } InhPaths;
33 /* Result codes for func_get_detail */
34 typedef enum
36 FUNCDETAIL_NOTFOUND, /* no matching function */
37 FUNCDETAIL_MULTIPLE, /* too many matching functions */
38 FUNCDETAIL_NORMAL, /* found a matching regular function */
39 FUNCDETAIL_AGGREGATE, /* found a matching aggregate function */
40 FUNCDETAIL_WINDOWFUNC, /* found a matching window function */
41 FUNCDETAIL_COERCION /* it's a type coercion request */
42 } FuncDetailCode;
45 extern Node *ParseFuncOrColumn(ParseState *pstate,
46 List *funcname, List *fargs,
47 bool agg_star, bool agg_distinct, bool func_variadic,
48 WindowDef *over, bool is_column, int location);
50 extern FuncDetailCode func_get_detail(List *funcname, List *fargs,
51 int nargs, Oid *argtypes,
52 bool expand_variadic, bool expand_defaults,
53 Oid *funcid, Oid *rettype,
54 bool *retset, int *nvargs, Oid **true_typeids,
55 List **argdefaults);
57 extern int func_match_argtypes(int nargs,
58 Oid *input_typeids,
59 FuncCandidateList raw_candidates,
60 FuncCandidateList *candidates);
62 extern FuncCandidateList func_select_candidate(int nargs,
63 Oid *input_typeids,
64 FuncCandidateList candidates);
66 extern void make_fn_arguments(ParseState *pstate,
67 List *fargs,
68 Oid *actual_arg_types,
69 Oid *declared_arg_types);
71 extern const char *funcname_signature_string(const char *funcname,
72 int nargs, const Oid *argtypes);
73 extern const char *func_signature_string(List *funcname,
74 int nargs, const Oid *argtypes);
76 extern Oid LookupFuncName(List *funcname, int nargs, const Oid *argtypes,
77 bool noError);
78 extern Oid LookupFuncNameTypeNames(List *funcname, List *argtypes,
79 bool noError);
80 extern Oid LookupAggNameTypeNames(List *aggname, List *argtypes,
81 bool noError);
83 #endif /* PARSE_FUNC_H */