diff options
| author | Tom Lane <tgl@sss.pgh.pa.us> | 2006-03-14 22:48:25 +0000 |
|---|---|---|
| committer | Tom Lane <tgl@sss.pgh.pa.us> | 2006-03-14 22:48:25 +0000 |
| commit | 20ab467d76d78271006818d2baf4c9c8658d1f38 (patch) | |
| tree | 7a536111b5cc4e494ac75558aad5655dfc8ab964 /src/include/parser/parse_oper.h | |
| parent | 48fb696753e267447f99914c7968d0b4ffb5c5dc (diff) | |
Improve parser so that we can show an error cursor position for errors
during parse analysis, not only errors detected in the flex/bison stages.
This is per my earlier proposal. This commit includes all the basic
infrastructure, but locations are only tracked and reported for errors
involving column references, function calls, and operators. More could
be done later but this seems like a good set to start with. I've also
moved the ReportSyntaxErrorPosition logic out of psql and into libpq,
which should make it available to more people --- even within psql this
is an improvement because warnings weren't handled by ReportSyntaxErrorPosition.
Diffstat (limited to 'src/include/parser/parse_oper.h')
| -rw-r--r-- | src/include/parser/parse_oper.h | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/src/include/parser/parse_oper.h b/src/include/parser/parse_oper.h index f3c2ee543ec..33e54ef01e0 100644 --- a/src/include/parser/parse_oper.h +++ b/src/include/parser/parse_oper.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/parser/parse_oper.h,v 1.38 2006/03/05 15:58:57 momjian Exp $ + * $PostgreSQL: pgsql/src/include/parser/parse_oper.h,v 1.39 2006/03/14 22:48:22 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -21,20 +21,27 @@ typedef HeapTuple Operator; /* Routines to look up an operator given name and exact input type(s) */ -extern Oid LookupOperName(List *opername, Oid oprleft, Oid oprright, - bool noError); -extern Oid LookupOperNameTypeNames(List *opername, TypeName *oprleft, - TypeName *oprright, bool noError); +extern Oid LookupOperName(ParseState *pstate, List *opername, + Oid oprleft, Oid oprright, + bool noError, int location); +extern Oid LookupOperNameTypeNames(ParseState *pstate, List *opername, + TypeName *oprleft, TypeName *oprright, + bool noError, int location); /* Routines to find operators matching a name and given input types */ /* NB: the selected operator may require coercion of the input types! */ -extern Operator oper(List *op, Oid arg1, Oid arg2, bool noError); -extern Operator right_oper(List *op, Oid arg, bool noError); -extern Operator left_oper(List *op, Oid arg, bool noError); +extern Operator oper(ParseState *pstate, List *op, Oid arg1, Oid arg2, + bool noError, int location); +extern Operator right_oper(ParseState *pstate, List *op, Oid arg, + bool noError, int location); +extern Operator left_oper(ParseState *pstate, List *op, Oid arg, + bool noError, int location); /* Routines to find operators that DO NOT require coercion --- ie, their */ /* input types are either exactly as given, or binary-compatible */ -extern Operator compatible_oper(List *op, Oid arg1, Oid arg2, bool noError); +extern Operator compatible_oper(ParseState *pstate, List *op, + Oid arg1, Oid arg2, + bool noError, int location); /* currently no need for compatible_left_oper/compatible_right_oper */ @@ -55,9 +62,9 @@ extern Oid oprfuncid(Operator op); /* Build expression tree for an operator invocation */ extern Expr *make_op(ParseState *pstate, List *opname, - Node *ltree, Node *rtree); + Node *ltree, Node *rtree, int location); extern Expr *make_scalar_array_op(ParseState *pstate, List *opname, bool useOr, - Node *ltree, Node *rtree); + Node *ltree, Node *rtree, int location); #endif /* PARSE_OPER_H */ |
