00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef PARSER_FUNC_H
00015 #define PARSER_FUNC_H
00016
00017 #include "catalog/namespace.h"
00018 #include "parser/parse_node.h"
00019
00020
00021
00022
00023
00024
00025
00026 typedef struct _InhPaths
00027 {
00028 int nsupers;
00029 Oid self;
00030 Oid *supervec;
00031 } InhPaths;
00032
00033
00034 typedef enum
00035 {
00036 FUNCDETAIL_NOTFOUND,
00037 FUNCDETAIL_MULTIPLE,
00038 FUNCDETAIL_NORMAL,
00039 FUNCDETAIL_AGGREGATE,
00040 FUNCDETAIL_WINDOWFUNC,
00041 FUNCDETAIL_COERCION
00042 } FuncDetailCode;
00043
00044
00045 extern Node *ParseFuncOrColumn(ParseState *pstate,
00046 List *funcname, List *fargs,
00047 List *agg_order, bool agg_star, bool agg_distinct,
00048 bool func_variadic,
00049 WindowDef *over, bool is_column, int location);
00050
00051 extern FuncDetailCode func_get_detail(List *funcname,
00052 List *fargs, List *fargnames,
00053 int nargs, Oid *argtypes,
00054 bool expand_variadic, bool expand_defaults,
00055 Oid *funcid, Oid *rettype,
00056 bool *retset, int *nvargs, Oid **true_typeids,
00057 List **argdefaults);
00058
00059 extern int func_match_argtypes(int nargs,
00060 Oid *input_typeids,
00061 FuncCandidateList raw_candidates,
00062 FuncCandidateList *candidates);
00063
00064 extern FuncCandidateList func_select_candidate(int nargs,
00065 Oid *input_typeids,
00066 FuncCandidateList candidates);
00067
00068 extern void make_fn_arguments(ParseState *pstate,
00069 List *fargs,
00070 Oid *actual_arg_types,
00071 Oid *declared_arg_types);
00072
00073 extern const char *funcname_signature_string(const char *funcname, int nargs,
00074 List *argnames, const Oid *argtypes);
00075 extern const char *func_signature_string(List *funcname, int nargs,
00076 List *argnames, const Oid *argtypes);
00077
00078 extern Oid LookupFuncName(List *funcname, int nargs, const Oid *argtypes,
00079 bool noError);
00080 extern Oid LookupFuncNameTypeNames(List *funcname, List *argtypes,
00081 bool noError);
00082 extern Oid LookupAggNameTypeNames(List *aggname, List *argtypes,
00083 bool noError);
00084
00085 #endif