Modulo syntax

Oleg Broytmann <phd@sun.med.ru>

From: Oleg Broytmann <phd@sun.med.ru>
To: PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 1999-03-17T08:49:55Z
Lists: pgsql-hackers
Hello!

   I ran the query
update producers SET cor_id = producer_id % 9 + 1;

   and found that result is eqiuvalent to
update producers SET cor_id = producer_id % 9;

   I added parens:
update producers SET cor_id = (producer_id % 9) + 1;

   and got what I needed.

   Is it a bug, a feature, or I just misinterpreted the syntax?

Oleg.
---- 
    Oleg Broytmann     http://members.xoom.com/phd2/     phd2@earthling.net
           Programmers don't die, they just GOSUB without RETURN.