1 /*-------------------------------------------------------------------------
7 * Copyright (c) 1994, Regents of the University of California
9 * $Id: parse_func.h,v 1.1 1997/11/25 22:06:56 momjian Exp $
11 *-------------------------------------------------------------------------
16 #include <nodes/nodes.h>
17 #include <nodes/pg_list.h>
18 #include <nodes/parsenodes.h>
19 #include <nodes/primnodes.h>
20 #include <parser/parse_func.h>
21 #include <parser/parse_node.h>
24 * This structure is used to explore the inheritance hierarchy above
25 * nodes in the type tree in order to disambiguate among polymorphic
28 typedef struct _InhPaths
30 int nsupers; /* number of superclasses */
31 Oid self; /* this class */
32 Oid *supervec; /* vector of superclasses */
36 * This structure holds a list of possible functions or operators that
37 * agree with the known name and argument types of the function/operator.
39 typedef struct _CandidateList
42 struct _CandidateList *next;
45 Node *ParseFunc(ParseState *pstate, char *funcname, List *fargs,
48 Oid funcid_get_rettype(Oid funcid);
50 CandidateList func_get_candidates(char *funcname, int nargs);
52 bool can_coerce(int nargs, Oid *input_typeids, Oid *func_typeids);
54 int match_argtypes(int nargs,
56 CandidateList function_typeids,
57 CandidateList *candidates);
59 Oid * func_select_candidate(int nargs,
61 CandidateList candidates);
63 bool func_get_detail(char *funcname,
66 Oid *funcid, /* return value */
67 Oid *rettype, /* return value */
68 bool *retset, /* return value */
71 Oid ** argtype_inherit(int nargs, Oid *oid_array);
73 int findsupers(Oid relid, Oid **supervec);
75 Oid **genxprod(InhPaths *arginh, int nargs);
77 void make_arguments(int nargs,
80 Oid *function_typeids);
82 List *setup_tlist(char *attname, Oid relid);
84 List *setup_base_tlist(Oid typeid);
86 Node *ParseComplexProjection(ParseState *pstate,
91 void func_error(char *caller, char *funcname, int nargs, Oid *argtypes);
96 #endif /* PARSE_FUNC_H */