2
0

parse_func.h 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /*-------------------------------------------------------------------------
  2. *
  3. * parse_func.h
  4. *
  5. *
  6. *
  7. * Portions Copyright (c) 1996-2022, 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 PARSE_FUNC_H
  15. #define PARSE_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_PROCEDURE, /* found a matching procedure */
  25. FUNCDETAIL_AGGREGATE, /* found a matching aggregate function */
  26. FUNCDETAIL_WINDOWFUNC, /* found a matching window function */
  27. FUNCDETAIL_COERCION /* it's a type coercion request */
  28. } FuncDetailCode;
  29. extern Node *ParseFuncOrColumn(ParseState *pstate, List *funcname, List *fargs,
  30. Node *last_srf, FuncCall *fn, bool proc_call,
  31. int location);
  32. extern FuncDetailCode func_get_detail(List *funcname,
  33. List *fargs, List *fargnames,
  34. int nargs, Oid *argtypes,
  35. bool expand_variadic, bool expand_defaults,
  36. bool include_out_arguments,
  37. Oid *funcid, Oid *rettype,
  38. bool *retset, int *nvargs, Oid *vatype,
  39. Oid **true_typeids, List **argdefaults);
  40. extern int func_match_argtypes(int nargs,
  41. Oid *input_typeids,
  42. FuncCandidateList raw_candidates,
  43. FuncCandidateList *candidates);
  44. extern FuncCandidateList func_select_candidate(int nargs,
  45. Oid *input_typeids,
  46. FuncCandidateList candidates);
  47. extern void make_fn_arguments(ParseState *pstate,
  48. List *fargs,
  49. Oid *actual_arg_types,
  50. Oid *declared_arg_types);
  51. extern const char *funcname_signature_string(const char *funcname, int nargs,
  52. List *argnames, const Oid *argtypes);
  53. extern const char *func_signature_string(List *funcname, int nargs,
  54. List *argnames, const Oid *argtypes);
  55. extern Oid LookupFuncName(List *funcname, int nargs, const Oid *argtypes,
  56. bool missing_ok);
  57. extern Oid LookupFuncWithArgs(ObjectType objtype, ObjectWithArgs *func,
  58. bool missing_ok);
  59. extern void check_srf_call_placement(ParseState *pstate, Node *last_srf,
  60. int location);
  61. #endif /* PARSE_FUNC_H */