Re: [BUGS] Money type does not detect over/underflow unlike int/int8 - Mailing list pgsql-bugs

From Kyotaro HORIGUCHI
Subject Re: [BUGS] Money type does not detect over/underflow unlike int/int8
Date
Msg-id CAM103DuJW==9bizbLDuWuDfzGfas0pG9e+zjPMwFVibZOs=ZGw@mail.gmail.com
Whole thread Raw
List pgsql-bugs
 i wrote:
>       result = (Cash)f * 100;
 >       if ((c > 0 && CASH_MAX / c <= result) ||
 >           (c < 0 && CASH_MIN / c >= result))
 >          ereport("overflow");

ah... this is still wrong. Will be different not so much, though.

regards,

--
Kyotaro Horiguchi
NTT Open Source Software Center


pgsql-bugs by date:

Previous
From: Huong Dangminh
Date:
Subject: Failed with build PostgreSQL in Windows ("--with-perl" option)
Next
From: david.ung@fr.abnamro.com
Date:
Subject: Re: [BUGS] BUG #14611: Black screen when launching pgadmin4