diff options
| author | Tom Lane <tgl@sss.pgh.pa.us> | 2001-10-04 22:06:46 +0000 |
|---|---|---|
| committer | Tom Lane <tgl@sss.pgh.pa.us> | 2001-10-04 22:06:46 +0000 |
| commit | 03b0a589d1d43c91224bc148d50c3242c6776058 (patch) | |
| tree | 1521f3ea552d3b3e5eafcc094587252c34a045e7 /src/include/parser/parse_func.h | |
| parent | 1ca0874faa235dca5f817dca04f12a29de44350c (diff) | |
| download | postgresql-03b0a589d1d43c91224bc148d50c3242c6776058.tar.gz | |
Consider interpreting a function call as a trivial (binary-compatible)
type coercion after failing to find an exact match in pg_proc, but before
considering interpretations that involve a function call with one or
more argument type coercions. This avoids surprises wherein what looks
like a type coercion is interpreted as coercing to some third type and
then to the destination type, as in Dave Blasby's bug report of 3-Oct-01.
See subsequent discussion in pghackers.
Diffstat (limited to 'src/include/parser/parse_func.h')
| -rw-r--r-- | src/include/parser/parse_func.h | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/include/parser/parse_func.h b/src/include/parser/parse_func.h index 105781b96c..44c774db5e 100644 --- a/src/include/parser/parse_func.h +++ b/src/include/parser/parse_func.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: parse_func.h,v 1.31 2001/05/19 00:33:20 momjian Exp $ + * $Id: parse_func.h,v 1.32 2001/10/04 22:06:46 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -38,6 +38,15 @@ typedef struct _CandidateList struct _CandidateList *next; } *CandidateList; +/* Result codes for func_get_detail */ +typedef enum +{ + FUNCDETAIL_NOTFOUND, /* no suitable interpretation */ + FUNCDETAIL_NORMAL, /* found a matching function */ + FUNCDETAIL_COERCION /* it's a type coercion request */ +} FuncDetailCode; + + extern Node *ParseNestedFuncOrColumn(ParseState *pstate, Attr *attr, int precedence); extern Node *ParseFuncOrColumn(ParseState *pstate, @@ -45,9 +54,10 @@ extern Node *ParseFuncOrColumn(ParseState *pstate, bool agg_star, bool agg_distinct, int precedence); -extern bool func_get_detail(char *funcname, int nargs, Oid *argtypes, - Oid *funcid, Oid *rettype, - bool *retset, Oid **true_typeids); +extern FuncDetailCode func_get_detail(char *funcname, List *fargs, + int nargs, Oid *argtypes, + Oid *funcid, Oid *rettype, + bool *retset, Oid **true_typeids); extern bool typeInheritsFrom(Oid subclassTypeId, Oid superclassTypeId); |
