1 /*-------------------------------------------------------------------------
7 * Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
8 * Portions Copyright (c) 1994, Regents of the University of California
12 *-------------------------------------------------------------------------
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
26 typedef struct _InhPaths
28 int nsupers
; /* number of superclasses */
29 Oid self
; /* this class */
30 Oid
*supervec
; /* vector of superclasses */
33 /* Result codes for func_get_detail */
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 */
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
,
56 FuncCandidateList raw_candidates
,
57 FuncCandidateList
*candidates
);
59 extern FuncCandidateList
func_select_candidate(int nargs
,
61 FuncCandidateList candidates
);
63 extern bool typeInheritsFrom(Oid subclassTypeId
, Oid superclassTypeId
);
65 extern void make_fn_arguments(ParseState
*pstate
,
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
,
77 extern Oid
LookupFuncNameTypeNames(List
*funcname
, List
*argtypes
,
79 extern Oid
LookupAggNameTypeNames(List
*aggname
, List
*argtypes
,
82 #endif /* PARSE_FUNC_H */