Peter Eisentraut - PostgreSQL <petere@hub.org> writes:
> Modified files:
> doc/src/sgml : syntax.sgml
> Log message:
> Choose a more suitable example for the operator precedence mis-parsing
> example.
I disagree with this change. The new example may be a more "useful"
computation than the old example, but it does not generate the desired
error message. Before, we got:
SELECT 5 ! ~ 6;
ERROR: Unable to identify an operator '!' for types 'int4' and 'int4'
You will have to retype this query using an explicit cast
The new example produces
SELECT 5 ! + 6;
ERROR: Unable to identify a left operator '+' for type 'int4'
You may need to add parentheses or an explicit cast
which would distract a reader from the primary point, namely that
the ambiguity between postfix and infix for '!' is what causes the
problem.
How do you feel about "SELECT 5 ! - 6;" as a compromise?
regards, tom lane