Modulo syntax - Mailing list pgsql-hackers

From Oleg Broytmann
Subject Modulo syntax
Date
Msg-id Pine.SOL2.3.96.SK.990317114623.27908A-100000@sun.med.ru
Whole thread Raw
Responses Re: [HACKERS] Modulo syntax
Re: [HACKERS] Modulo syntax
List 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
justGOSUB without RETURN.
 



pgsql-hackers by date:

Previous
From: jwieck@debis.com (Jan Wieck)
Date:
Subject: Re: [HACKERS] Re: Developers Globe (FINAL)
Next
From: jwieck@debis.com (Jan Wieck)
Date:
Subject: Re: [HACKERS] Re: Developers Globe (FINAL)