From: Peter Eisentraut Date: Sat, 24 Feb 2001 18:09:51 +0000 (+0000) Subject: Choose a more suitable example for the operator precedence mis-parsing X-Git-Tag: REL7_1~295 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3460181c3c571d690576c1d7621abfbd78861112;p=postgresql Choose a more suitable example for the operator precedence mis-parsing example. --- diff --git a/doc/src/sgml/syntax.sgml b/doc/src/sgml/syntax.sgml index cd463488fb..181d113a41 100644 --- a/doc/src/sgml/syntax.sgml +++ b/doc/src/sgml/syntax.sgml @@ -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's too late --- that - ! is defined as a postfix operator not an infix one. + 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.