1997-11-25 23:07:18 +01:00
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
*
|
1999-02-14 00:22:53 +01:00
|
|
|
* parse_func.h
|
1997-11-25 23:07:18 +01:00
|
|
|
*
|
|
|
|
*
|
|
|
|
*
|
2001-01-24 20:43:33 +01:00
|
|
|
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
|
2000-01-26 06:58:53 +01:00
|
|
|
* Portions Copyright (c) 1994, Regents of the University of California
|
1997-11-25 23:07:18 +01:00
|
|
|
*
|
2001-10-28 07:26:15 +01:00
|
|
|
* $Id: parse_func.h,v 1.34 2001/10/28 06:26:08 momjian Exp $
|
1997-11-25 23:07:18 +01:00
|
|
|
*
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
#ifndef PARSER_FUNC_H
|
|
|
|
#define PARSER_FUNC_H
|
|
|
|
|
1999-07-16 01:04:24 +02:00
|
|
|
#include "parser/parse_node.h"
|
1997-11-25 23:07:18 +01: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;
|
|
|
|
} *CandidateList;
|
|
|
|
|
2001-10-05 00:06:46 +02:00
|
|
|
/* Result codes for func_get_detail */
|
|
|
|
typedef enum
|
|
|
|
{
|
2001-10-28 07:26:15 +01:00
|
|
|
FUNCDETAIL_NOTFOUND, /* no suitable interpretation */
|
|
|
|
FUNCDETAIL_NORMAL, /* found a matching function */
|
|
|
|
FUNCDETAIL_COERCION /* it's a type coercion request */
|
2001-10-05 00:06:46 +02:00
|
|
|
} FuncDetailCode;
|
|
|
|
|
|
|
|
|
1999-05-25 18:15:34 +02:00
|
|
|
extern Node *ParseNestedFuncOrColumn(ParseState *pstate, Attr *attr,
|
2001-03-22 05:01:46 +01:00
|
|
|
int precedence);
|
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-19 02:33:20 +02:00
|
|
|
extern Node *ParseFuncOrColumn(ParseState *pstate,
|
2001-03-22 05:01:46 +01:00
|
|
|
char *funcname, List *fargs,
|
|
|
|
bool agg_star, bool agg_distinct,
|
|
|
|
int precedence);
|
1997-11-25 23:07:18 +01:00
|
|
|
|
2001-10-05 00:06:46 +02:00
|
|
|
extern FuncDetailCode func_get_detail(char *funcname, List *fargs,
|
2001-10-25 07:50:21 +02:00
|
|
|
int nargs, Oid *argtypes,
|
|
|
|
Oid *funcid, Oid *rettype,
|
|
|
|
bool *retset, Oid **true_typeids);
|
2000-08-20 02:44:19 +02:00
|
|
|
|
2000-03-16 07:35:07 +01:00
|
|
|
extern bool typeInheritsFrom(Oid subclassTypeId, Oid superclassTypeId);
|
|
|
|
|
1999-06-18 00:21:41 +02:00
|
|
|
extern void func_error(char *caller, char *funcname,
|
2000-04-12 19:17:23 +02:00
|
|
|
int nargs, Oid *argtypes, char *msg);
|
2001-10-28 07:26:15 +01:00
|
|
|
|
1998-09-01 06:40:42 +02:00
|
|
|
#endif /* PARSE_FUNC_H */
|