Even better example for operator precedence mis-parsing.
authorPeter Eisentraut
Sun, 25 Feb 2001 16:05:21 +0000 (16:05 +0000)
committerPeter Eisentraut
Sun, 25 Feb 2001 16:05:21 +0000 (16:05 +0000)
doc/src/sgml/syntax.sgml

index 181d113a415dc232d59267a19c4160c421e97efd..1e95caa637c17570ea95a99f183ccb6bf7d88612 100644 (file)
@@ -1,5 +1,5 @@
 
 
 
@@ -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.