aboutsummaryrefslogtreecommitdiff
path: root/src/backend/parser/parse_oper.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2000-03-18 19:53:54 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2000-03-18 19:53:54 +0000
commitd63e05a63875452067c6f360cc3cfda2f9a63dd3 (patch)
tree0ef5a6a2e9c5e7b825711ad9952d1fc069dfbff5 /src/backend/parser/parse_oper.c
parentf91dd7880f28e881c62102c22f496afb547950c7 (diff)
downloadpostgresql-d63e05a63875452067c6f360cc3cfda2f9a63dd3.tar.gz
postgresql-d63e05a63875452067c6f360cc3cfda2f9a63dd3.zip
Improve error message wording in unary_op_error() --- suggest that
problem could be lack of parentheses. This addresses cases like X UserOp UserOp Y, which will be parsed as (X UserOp) UserOp Y, whereas what likely was wanted was X UserOp (UserOp Y).
Diffstat (limited to 'src/backend/parser/parse_oper.c')
-rw-r--r--src/backend/parser/parse_oper.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/backend/parser/parse_oper.c b/src/backend/parser/parse_oper.c
index 7820060b91e..c944d235784 100644
--- a/src/backend/parser/parse_oper.c
+++ b/src/backend/parser/parse_oper.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/parser/parse_oper.c,v 1.37 2000/03/11 23:17:47 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/parser/parse_oper.c,v 1.38 2000/03/18 19:53:54 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -703,18 +703,14 @@ op_error(char *op, Oid arg1, Oid arg2)
if (typeidIsValid(arg1))
tp1 = typeidType(arg1);
else
- {
elog(ERROR, "Left hand side of operator '%s' has an unknown type"
"\n\tProbably a bad attribute name", op);
- }
if (typeidIsValid(arg2))
tp2 = typeidType(arg2);
else
- {
elog(ERROR, "Right hand side of operator %s has an unknown type"
"\n\tProbably a bad attribute name", op);
- }
elog(ERROR, "Unable to identify an operator '%s' for types '%s' and '%s'"
"\n\tYou will have to retype this query using an explicit cast",
@@ -741,7 +737,7 @@ unary_op_error(char *op, Oid arg, bool is_left_op)
}
elog(ERROR, "Unable to identify a %s operator '%s' for type '%s'"
- "\n\tYou will have to retype this query using an explicit cast",
+ "\n\tYou may need to add parentheses or an explicit cast",
(is_left_op ? "left" : "right"),
op, typeTypeName(tp1));
}