postgresql/src/include/parser/parse_func.h

84 lines
2.6 KiB
C
Raw Normal View History

/*-------------------------------------------------------------------------
*
* parse_func.h
*
*
*
2009-01-01 18:24:05 +01:00
* Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $PostgreSQL: pgsql/src/include/parser/parse_func.h,v 1.65 2009/05/12 00:56:05 tgl Exp $
*
*-------------------------------------------------------------------------
*/
#ifndef PARSER_FUNC_H
#define PARSER_FUNC_H
#include "catalog/namespace.h"
#include "parser/parse_node.h"
/*
* This structure is used to explore the inheritance hierarchy above
* nodes in the type tree in order to disambiguate among polymorphic
* functions.
*/
typedef struct _InhPaths
{
int nsupers; /* number of superclasses */
Oid self; /* this class */
Oid *supervec; /* vector of superclasses */
} InhPaths;
/* Result codes for func_get_detail */
typedef enum
{
FUNCDETAIL_NOTFOUND, /* no matching function */
FUNCDETAIL_MULTIPLE, /* too many matching functions */
FUNCDETAIL_NORMAL, /* found a matching regular function */
FUNCDETAIL_AGGREGATE, /* found a matching aggregate function */
FUNCDETAIL_WINDOWFUNC, /* found a matching window function */
FUNCDETAIL_COERCION /* it's a type coercion request */
} FuncDetailCode;
extern Node *ParseFuncOrColumn(ParseState *pstate,
List *funcname, List *fargs,
bool agg_star, bool agg_distinct, bool func_variadic,
WindowDef *over, bool is_column, int location);
extern FuncDetailCode func_get_detail(List *funcname, List *fargs,
int nargs, Oid *argtypes,
bool expand_variadic, bool expand_defaults,
Oid *funcid, Oid *rettype,
bool *retset, int *nvargs, Oid **true_typeids,
List **argdefaults);
2003-08-04 02:43:34 +02:00
extern int func_match_argtypes(int nargs,
Oid *input_typeids,
FuncCandidateList raw_candidates,
FuncCandidateList *candidates);
extern FuncCandidateList func_select_candidate(int nargs,
2003-08-04 02:43:34 +02:00
Oid *input_typeids,
FuncCandidateList candidates);
extern void make_fn_arguments(ParseState *pstate,
2003-08-04 02:43:34 +02:00
List *fargs,
Oid *actual_arg_types,
Oid *declared_arg_types);
extern const char *funcname_signature_string(const char *funcname,
2003-08-04 02:43:34 +02:00
int nargs, const Oid *argtypes);
extern const char *func_signature_string(List *funcname,
2003-08-04 02:43:34 +02:00
int nargs, const Oid *argtypes);
2003-08-04 02:43:34 +02:00
extern Oid LookupFuncName(List *funcname, int nargs, const Oid *argtypes,
bool noError);
2002-09-04 22:31:48 +02:00
extern Oid LookupFuncNameTypeNames(List *funcname, List *argtypes,
2003-08-04 02:43:34 +02:00
bool noError);
extern Oid LookupAggNameTypeNames(List *aggname, List *argtypes,
2006-10-04 02:30:14 +02:00
bool noError);
#endif /* PARSE_FUNC_H */