Header And Logo

PostgreSQL
| The world's most advanced open source database.

parse_func.h

Go to the documentation of this file.
00001 /*-------------------------------------------------------------------------
00002  *
00003  * parse_func.h
00004  *
00005  *
00006  *
00007  * Portions Copyright (c) 1996-2013, PostgreSQL Global Development Group
00008  * Portions Copyright (c) 1994, Regents of the University of California
00009  *
00010  * src/include/parser/parse_func.h
00011  *
00012  *-------------------------------------------------------------------------
00013  */
00014 #ifndef PARSER_FUNC_H
00015 #define PARSER_FUNC_H
00016 
00017 #include "catalog/namespace.h"
00018 #include "parser/parse_node.h"
00019 
00020 
00021 /*
00022  *  This structure is used to explore the inheritance hierarchy above
00023  *  nodes in the type tree in order to disambiguate among polymorphic
00024  *  functions.
00025  */
00026 typedef struct _InhPaths
00027 {
00028     int         nsupers;        /* number of superclasses */
00029     Oid         self;           /* this class */
00030     Oid        *supervec;       /* vector of superclasses */
00031 }   InhPaths;
00032 
00033 /* Result codes for func_get_detail */
00034 typedef enum
00035 {
00036     FUNCDETAIL_NOTFOUND,        /* no matching function */
00037     FUNCDETAIL_MULTIPLE,        /* too many matching functions */
00038     FUNCDETAIL_NORMAL,          /* found a matching regular function */
00039     FUNCDETAIL_AGGREGATE,       /* found a matching aggregate function */
00040     FUNCDETAIL_WINDOWFUNC,      /* found a matching window function */
00041     FUNCDETAIL_COERCION         /* it's a type coercion request */
00042 } FuncDetailCode;
00043 
00044 
00045 extern Node *ParseFuncOrColumn(ParseState *pstate,
00046                   List *funcname, List *fargs,
00047                   List *agg_order, bool agg_star, bool agg_distinct,
00048                   bool func_variadic,
00049                   WindowDef *over, bool is_column, int location);
00050 
00051 extern FuncDetailCode func_get_detail(List *funcname,
00052                 List *fargs, List *fargnames,
00053                 int nargs, Oid *argtypes,
00054                 bool expand_variadic, bool expand_defaults,
00055                 Oid *funcid, Oid *rettype,
00056                 bool *retset, int *nvargs, Oid **true_typeids,
00057                 List **argdefaults);
00058 
00059 extern int func_match_argtypes(int nargs,
00060                     Oid *input_typeids,
00061                     FuncCandidateList raw_candidates,
00062                     FuncCandidateList *candidates);
00063 
00064 extern FuncCandidateList func_select_candidate(int nargs,
00065                       Oid *input_typeids,
00066                       FuncCandidateList candidates);
00067 
00068 extern void make_fn_arguments(ParseState *pstate,
00069                   List *fargs,
00070                   Oid *actual_arg_types,
00071                   Oid *declared_arg_types);
00072 
00073 extern const char *funcname_signature_string(const char *funcname, int nargs,
00074                           List *argnames, const Oid *argtypes);
00075 extern const char *func_signature_string(List *funcname, int nargs,
00076                       List *argnames, const Oid *argtypes);
00077 
00078 extern Oid LookupFuncName(List *funcname, int nargs, const Oid *argtypes,
00079                bool noError);
00080 extern Oid LookupFuncNameTypeNames(List *funcname, List *argtypes,
00081                         bool noError);
00082 extern Oid LookupAggNameTypeNames(List *aggname, List *argtypes,
00083                        bool noError);
00084 
00085 #endif   /* PARSE_FUNC_H */