Rémi Cura <remi.c...@gmail.com> wrote:

> According to the doc
> ( 
> http://www.postgresql.org/docs/9.2/static/sql-syntax-lexical.html#SQL-SYNTAX-OPERATORS
>  ),
> multiplication has precedence on division. (I supposed it implicitely)

The correct link is:

http://www.postgresql.org/docs/9.2/static/sql-syntax-lexical.html#SQL-PRECEDENCE-TABLE

And it shows multiplication, division, and modulo as having equal
precedence, with left-to-right associativity.

> So anyway the query is parsed as ( 1/ (2*3.2)) and ( 3.2*1) / 2 ),

No, it is ((1 / 2) * 3.2) and ((3.2 * 1) / 2).

Those evaluate to (0 * 3.2) and (3.2 / 2), respectively.

--
Kevin Grittner
EDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

Reply via email to