]> granicus.if.org Git - postgresql/blob - src/include/parser/parse_func.h
Phase 2 of pgindent updates.
[postgresql] / src / include / parser / parse_func.h
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 */
30 } FuncDetailCode;
31
32
33 extern Node *ParseFuncOrColumn(ParseState *pstate, List *funcname, List *fargs,
34                                   Node *last_srf, 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
49 extern FuncCandidateList func_select_candidate(int nargs,
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 LookupFuncWithArgs(ObjectWithArgs *func,
66                                    bool noError);
67 extern Oid LookupAggWithArgs(ObjectWithArgs *agg,
68                                   bool noError);
69
70 extern void check_srf_call_placement(ParseState *pstate, Node *last_srf,
71                                                  int location);
72
73 #endif                                                  /* PARSE_FUNC_H */