1 /*-------------------------------------------------------------------------
7 * Copyright (c) 1994, Regents of the University of California
9 * $Id: parse_func.h,v 1.2 1997/11/26 01:14:04 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 extern Node *ParseFunc(ParseState *pstate, char *funcname, List *fargs,
47 extern Oid funcid_get_rettype(Oid funcid);
48 extern CandidateList func_get_candidates(char *funcname, int nargs);
49 extern bool can_coerce(int nargs, Oid *input_typeids, Oid *func_typeids);
50 extern int match_argtypes(int nargs,
52 CandidateList function_typeids,
53 CandidateList *candidates);
54 extern Oid * func_select_candidate(int nargs,
56 CandidateList candidates);
57 extern bool func_get_detail(char *funcname,
60 Oid *funcid, /* return value */
61 Oid *rettype, /* return value */
62 bool *retset, /* return value */
64 extern Oid ** argtype_inherit(int nargs, Oid *oid_array);
65 extern int findsupers(Oid relid, Oid **supervec);
66 extern Oid **genxprod(InhPaths *arginh, int nargs);
67 extern void make_arguments(int nargs,
70 Oid *function_typeids);
72 extern List *setup_tlist(char *attname, Oid relid);
73 extern List *setup_base_tlist(Oid typeid);
74 extern Node *ParseComplexProjection(ParseState *pstate,
78 extern void func_error(char *caller, char *funcname, int nargs, Oid *argtypes);
80 #endif /* PARSE_FUNC_H */