Skip to content

Commit fcabd07

Browse files
author
Thomas G. Lockhart
committed
Change precedence for boolean operators to match expected behavior.
Change NOTICE/NOTICE/NOTICE/WARN elog messages to a single message with a few newline/tab breaks embedded in the string. Much cleaner I hope.
1 parent cc19151 commit fcabd07

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

src/backend/parser/gram.y

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*
1111
*
1212
* IDENTIFICATION
13-
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 1.81 1997/12/24 06:06:26 momjian Exp $
13+
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 1.82 1998/01/01 05:44:53 thomas Exp $
1414
*
1515
* HISTORY
1616
* AUTHOR DATE MAJOR EVENT
@@ -306,10 +306,11 @@ Oid param_type(int t); /* used in parse_expr.c */
306306
%left AND
307307
%right NOT
308308
%right '='
309+
%nonassoc '<' '>'
309310
%nonassoc LIKE
310311
%nonassoc BETWEEN
311312
%nonassoc IN
312-
%nonassoc Op
313+
%nonassoc Op /* multi-character ops and user-defined operators */
313314
%nonassoc NOTNULL
314315
%nonassoc ISNULL
315316
%nonassoc IS
@@ -319,7 +320,6 @@ Oid param_type(int t); /* used in parse_expr.c */
319320
/* Unary Operators */
320321
%right ':'
321322
%left ';' /* end of statement or natural log */
322-
%nonassoc '<' '>'
323323
%right UMINUS
324324
%left '.'
325325
%left '[' ']'

src/backend/parser/parse_oper.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/parser/parse_oper.c,v 1.3 1997/11/26 03:42:45 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/parser/parse_oper.c,v 1.4 1998/01/01 05:44:54 thomas Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -587,11 +587,17 @@ op_error(char *op, Oid arg1, Oid arg2)
587587
elog(WARN, "right hand side of operator %s has an unknown type, probably a bad attribute name", op);
588588
}
589589

590+
#if FALSE
590591
elog(NOTICE, "there is no operator %s for types %s and %s",
591592
op, typeTypeName(tp1), typeTypeName(tp2));
592593
elog(NOTICE, "You will either have to retype this query using an");
593594
elog(NOTICE, "explicit cast, or you will have to define the operator");
594595
elog(WARN, "%s for %s and %s using CREATE OPERATOR",
595596
op, typeTypeName(tp1), typeTypeName(tp2));
597+
#endif
598+
elog(WARN, "There is no operator '%s' for types '%s' and '%s'"
599+
"\n\tYou will either have to retype this query using an explicit cast,"
600+
"\n\tor you will have to define the operator using CREATE OPERATOR",
601+
op, typeTypeName(tp1), typeTypeName(tp2));
596602
}
597603

0 commit comments

Comments
 (0)