PostgreSQL Source Code  git master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
parse_func.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  *
3  * parse_func.h
4  *
5  *
6  *
7  * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
8  * Portions Copyright (c) 1994, Regents of the University of California
9  *
10  * src/include/parser/parse_func.h
11  *
12  *-------------------------------------------------------------------------
13  */
14 #ifndef PARSER_FUNC_H
15 #define PARSER_FUNC_H
16 
17 #include "catalog/namespace.h"
18 #include "parser/parse_node.h"
19 
20 
21 /* Result codes for func_get_detail */
22 typedef enum
23 {
24  FUNCDETAIL_NOTFOUND, /* no matching function */
25  FUNCDETAIL_MULTIPLE, /* too many matching functions */
26  FUNCDETAIL_NORMAL, /* found a matching regular function */
27  FUNCDETAIL_AGGREGATE, /* found a matching aggregate function */
28  FUNCDETAIL_WINDOWFUNC, /* found a matching window function */
29  FUNCDETAIL_COERCION /* it's a type coercion request */
31 
32 
33 extern Node *ParseFuncOrColumn(ParseState *pstate, List *funcname, List *fargs,
34  FuncCall *fn, int location);
35 
36 extern FuncDetailCode func_get_detail(List *funcname,
37  List *fargs, List *fargnames,
38  int nargs, Oid *argtypes,
39  bool expand_variadic, bool expand_defaults,
40  Oid *funcid, Oid *rettype,
41  bool *retset, int *nvargs, Oid *vatype,
42  Oid **true_typeids, List **argdefaults);
43 
44 extern int func_match_argtypes(int nargs,
45  Oid *input_typeids,
46  FuncCandidateList raw_candidates,
47  FuncCandidateList *candidates);
48 
50  Oid *input_typeids,
51  FuncCandidateList candidates);
52 
53 extern void make_fn_arguments(ParseState *pstate,
54  List *fargs,
55  Oid *actual_arg_types,
56  Oid *declared_arg_types);
57 
58 extern const char *funcname_signature_string(const char *funcname, int nargs,
59  List *argnames, const Oid *argtypes);
60 extern const char *func_signature_string(List *funcname, int nargs,
61  List *argnames, const Oid *argtypes);
62 
63 extern Oid LookupFuncName(List *funcname, int nargs, const Oid *argtypes,
64  bool noError);
65 extern Oid LookupFuncNameTypeNames(List *funcname, List *argtypes,
66  bool noError);
67 extern Oid LookupAggNameTypeNames(List *aggname, List *argtypes,
68  bool noError);
69 
70 extern void check_srf_call_placement(ParseState *pstate, int location);
71 
72 #endif /* PARSE_FUNC_H */
void make_fn_arguments(ParseState *pstate, List *fargs, Oid *actual_arg_types, Oid *declared_arg_types)
Definition: parse_func.c:1692
Node * ParseFuncOrColumn(ParseState *pstate, List *funcname, List *fargs, FuncCall *fn, int location)
Definition: parse_func.c:69
int func_match_argtypes(int nargs, Oid *input_typeids, FuncCandidateList raw_candidates, FuncCandidateList *candidates)
Definition: parse_func.c:792
Definition: nodes.h:508
unsigned int Oid
Definition: postgres_ext.h:31
const char * funcname_signature_string(const char *funcname, int nargs, List *argnames, const Oid *argtypes)
Definition: parse_func.c:1852
Oid LookupFuncNameTypeNames(List *funcname, List *argtypes, bool noError)
Definition: parse_func.c:1940
const char * func_signature_string(List *funcname, int nargs, List *argnames, const Oid *argtypes)
Definition: parse_func.c:1889
FuncDetailCode
Definition: parse_func.h:22
FuncDetailCode func_get_detail(List *funcname, List *fargs, List *fargnames, int nargs, Oid *argtypes, bool expand_variadic, bool expand_defaults, Oid *funcid, Oid *rettype, bool *retset, int *nvargs, Oid *vatype, Oid **true_typeids, List **argdefaults)
Definition: parse_func.c:1264
static void * fn(void *arg)
Oid LookupAggNameTypeNames(List *aggname, List *argtypes, bool noError)
Definition: parse_func.c:1977
FuncCandidateList func_select_candidate(int nargs, Oid *input_typeids, FuncCandidateList candidates)
Definition: parse_func.c:877
Oid LookupFuncName(List *funcname, int nargs, const Oid *argtypes, bool noError)
Definition: parse_func.c:1908
void check_srf_call_placement(ParseState *pstate, int location)
Definition: parse_func.c:2057
Definition: pg_list.h:45