pgsql/doc/src/sgml syntax.sgml

Started by Peter Eisentraut - PostgreSQLover 25 years ago3 messagescomitters
Jump to latest

CVSROOT: /home/projects/pgsql/cvsroot
Module name: pgsql
Changes by: petere@hub.org 01/02/24 13:09:57

Modified files:
doc/src/sgml : syntax.sgml

Log message:
Choose a more suitable example for the operator precedence mis-parsing
example.

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Peter Eisentraut - PostgreSQL (#1)
Re: pgsql/doc/src/sgml syntax.sgml

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

#3Peter Eisentraut
peter_e@gmx.net
In reply to: Tom Lane (#2)
Re: pgsql/doc/src/sgml syntax.sgml

Tom Lane writes:

How do you feel about "SELECT 5 ! - 6;" as a compromise?

Perfect.

--
Peter Eisentraut peter_e@gmx.net http://yi.org/peter-e/