1997-11-25 17:07:18 -05:00
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
|
*
|
1999-02-13 18:22:53 -05:00
|
|
|
* parse_func.h
|
1997-11-25 17:07:18 -05:00
|
|
|
*
|
|
|
|
|
*
|
|
|
|
|
*
|
2001-01-24 14:43:33 -05:00
|
|
|
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
|
2000-01-26 00:58:53 -05:00
|
|
|
* Portions Copyright (c) 1994, Regents of the University of California
|
1997-11-25 17:07:18 -05:00
|
|
|
*
|
2002-03-29 14:06:29 -05:00
|
|
|
* $Id: parse_func.h,v 1.37 2002/03/29 19:06:24 tgl Exp $
|
1997-11-25 17:07:18 -05:00
|
|
|
*
|
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
|
#ifndef PARSER_FUNC_H
|
|
|
|
|
#define PARSER_FUNC_H
|
|
|
|
|
|
1999-07-15 19:04:24 -04:00
|
|
|
#include "parser/parse_node.h"
|
1997-11-25 17:07:18 -05:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* 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;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* This structure holds a list of possible functions or operators that
|
|
|
|
|
* agree with the known name and argument types of the function/operator.
|
|
|
|
|
*/
|
|
|
|
|
typedef struct _CandidateList
|
|
|
|
|
{
|
|
|
|
|
Oid *args;
|
|
|
|
|
struct _CandidateList *next;
|
2001-11-05 12:46:40 -05:00
|
|
|
} *CandidateList;
|
1997-11-25 17:07:18 -05:00
|
|
|
|
2001-10-04 18:06:46 -04:00
|
|
|
/* Result codes for func_get_detail */
|
|
|
|
|
typedef enum
|
|
|
|
|
{
|
2001-10-28 01:26:15 -05:00
|
|
|
FUNCDETAIL_NOTFOUND, /* no suitable interpretation */
|
|
|
|
|
FUNCDETAIL_NORMAL, /* found a matching function */
|
|
|
|
|
FUNCDETAIL_COERCION /* it's a type coercion request */
|
2001-10-04 18:06:46 -04:00
|
|
|
} FuncDetailCode;
|
|
|
|
|
|
|
|
|
|
|
New comment. This func/column things has always confused me.
/*
* parse function
* This code is confusing because the database can accept
* relation.column, column.function, or relation.column.function.
* In these cases, funcname is the last parameter, and fargs are
* the rest.
*
* It can also be called as func(col) or func(col,col).
* In this case, Funcname is the part before parens, and fargs
* are the part in parens.
*
*/
Node *
ParseFuncOrColumn(ParseState *pstate, char *funcname, List *fargs,
bool agg_star, bool agg_distinct,
int precedence)
2001-05-18 20:33:20 -04:00
|
|
|
extern Node *ParseFuncOrColumn(ParseState *pstate,
|
2001-03-21 23:01:46 -05:00
|
|
|
char *funcname, List *fargs,
|
2002-03-21 11:02:16 -05:00
|
|
|
bool agg_star, bool agg_distinct, bool is_column);
|
1997-11-25 17:07:18 -05:00
|
|
|
|
2001-10-04 18:06:46 -04:00
|
|
|
extern FuncDetailCode func_get_detail(char *funcname, List *fargs,
|
2001-10-25 01:50:21 -04:00
|
|
|
int nargs, Oid *argtypes,
|
|
|
|
|
Oid *funcid, Oid *rettype,
|
|
|
|
|
bool *retset, Oid **true_typeids);
|
2000-08-19 20:44:19 -04:00
|
|
|
|
2000-03-16 01:35:07 -05:00
|
|
|
extern bool typeInheritsFrom(Oid subclassTypeId, Oid superclassTypeId);
|
|
|
|
|
|
2002-03-29 14:06:29 -05:00
|
|
|
extern void func_error(const char *caller, const char *funcname,
|
|
|
|
|
int nargs, const Oid *argtypes,
|
|
|
|
|
const char *msg);
|
2001-10-28 01:26:15 -05:00
|
|
|
|
2001-11-05 12:46:40 -05:00
|
|
|
#endif /* PARSE_FUNC_H */
|