Fix pg_dump bug in the database-level collation patch. "datcollate" and
[PostgreSQL.git] / src / include / parser / parse_func.h
blobf94837320aa19e45160f20c0cbb003499760e82a
1 /*-------------------------------------------------------------------------
3 * parse_func.h
7 * Portions Copyright (c) 1996-2008, 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_COERCION /* it's a type coercion request */
41 } FuncDetailCode;
44 extern Node *ParseFuncOrColumn(ParseState *pstate,
45 List *funcname, List *fargs,
46 bool agg_star, bool agg_distinct, bool func_variadic,
47 bool is_column, int location);
49 extern FuncDetailCode func_get_detail(List *funcname, List *fargs,
50 int nargs, Oid *argtypes, bool expand_variadic,
51 Oid *funcid, Oid *rettype,
52 bool *retset, int *nvargs, Oid **true_typeids);
54 extern int func_match_argtypes(int nargs,
55 Oid *input_typeids,
56 FuncCandidateList raw_candidates,
57 FuncCandidateList *candidates);
59 extern FuncCandidateList func_select_candidate(int nargs,
60 Oid *input_typeids,
61 FuncCandidateList candidates);
63 extern bool typeInheritsFrom(Oid subclassTypeId, Oid superclassTypeId);
65 extern void make_fn_arguments(ParseState *pstate,
66 List *fargs,
67 Oid *actual_arg_types,
68 Oid *declared_arg_types);
70 extern const char *funcname_signature_string(const char *funcname,
71 int nargs, const Oid *argtypes);
72 extern const char *func_signature_string(List *funcname,
73 int nargs, const Oid *argtypes);
75 extern Oid LookupFuncName(List *funcname, int nargs, const Oid *argtypes,
76 bool noError);
77 extern Oid LookupFuncNameTypeNames(List *funcname, List *argtypes,
78 bool noError);
79 extern Oid LookupAggNameTypeNames(List *aggname, List *argtypes,
80 bool noError);
82 #endif /* PARSE_FUNC_H */