parse_func.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /*-------------------------------------------------------------------------
  2. *
  3. * parse_func.h
  4. *
  5. *
  6. *
  7. * Portions Copyright (c) 1996-2016, 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. #include "catalog/namespace.h"
  17. #include "parser/parse_node.h"
  18. /* Result codes for func_get_detail */
  19. typedef enum
  20. {
  21. FUNCDETAIL_NOTFOUND, /* no matching function */
  22. FUNCDETAIL_MULTIPLE, /* too many matching functions */
  23. FUNCDETAIL_NORMAL, /* found a matching regular function */
  24. FUNCDETAIL_AGGREGATE, /* found a matching aggregate function */
  25. FUNCDETAIL_WINDOWFUNC, /* found a matching window function */
  26. FUNCDETAIL_COERCION /* it's a type coercion request */
  27. } FuncDetailCode;
  28. extern Node *ParseFuncOrColumn(ParseState *pstate, List *funcname, List *fargs,
  29. FuncCall *fn, int location);
  30. extern FuncDetailCode func_get_detail(List *funcname,
  31. List *fargs, List *fargnames,
  32. int nargs, Oid *argtypes,
  33. bool expand_variadic, bool expand_defaults,
  34. Oid *funcid, Oid *rettype,
  35. bool *retset, int *nvargs, Oid *vatype,
  36. Oid **true_typeids, List **argdefaults);
  37. extern int func_match_argtypes(int nargs,
  38. Oid *input_typeids,
  39. FuncCandidateList raw_candidates,
  40. FuncCandidateList *candidates);
  41. extern FuncCandidateList func_select_candidate(int nargs,
  42. Oid *input_typeids,
  43. FuncCandidateList candidates);
  44. extern void make_fn_arguments(ParseState *pstate,
  45. List *fargs,
  46. Oid *actual_arg_types,
  47. Oid *declared_arg_types);
  48. extern const char *funcname_signature_string(const char *funcname, int nargs,
  49. List *argnames, const Oid *argtypes);
  50. extern const char *func_signature_string(List *funcname, int nargs,
  51. List *argnames, const Oid *argtypes);
  52. extern Oid LookupFuncName(List *funcname, int nargs, const Oid *argtypes,
  53. bool noError);
  54. extern Oid LookupFuncNameTypeNames(List *funcname, List *argtypes,
  55. bool noError);
  56. extern Oid LookupAggNameTypeNames(List *aggname, List *argtypes,
  57. bool noError);
  58. #endif /* PARSE_FUNC_H */