From efe6707e9ce0e96982dae6ca34d807df70d65490 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Sun, 25 Feb 2001 16:05:21 +0000 Subject: [PATCH] Even better example for operator precedence mis-parsing. --- doc/src/sgml/syntax.sgml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/src/sgml/syntax.sgml b/doc/src/sgml/syntax.sgml index 0adf395a4f..90255870b2 100644 --- a/doc/src/sgml/syntax.sgml +++ b/doc/src/sgml/syntax.sgml @@ -905,17 +905,17 @@ sqrt(2) you will sometimes need to add parentheses when using combinations of binary and unary operators. For instance -SELECT 5 ! + 6; +SELECT 5 ! - 6; will be parsed as -SELECT 5 ! (+ 6); +SELECT 5 ! (- 6); because the parser has no idea -- until it is too late -- that ! is defined as a postfix operator, not an infix one. To get the desired behavior in this case, you must write -SELECT (5 !) + 6; +SELECT (5 !) - 6; This is the price one pays for extensibility. -- 2.39.5