Re: cast from integer to money

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: cast from integer to money
Дата
Msg-id 29676.1301929096@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: cast from integer to money  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: cast from integer to money  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> On Apr 4, 2011, at 1:46 AM, Joseph Adams <joeyadams3.14159@gmail.com> wrote:
>> On Sun, Apr 3, 2011 at 11:23 PM, Robert Haas <robertmhaas@gmail.com> wrote:
>>> Thanks for the patch, but I think you forgot to worry about overflow:

>> cash_in doesn't test for overflow, either (tested on 8.4.0, 9.0.3, and HEAD):
>> Is this a bug?

> Seems like it. You have to feel sorry for the guy who deposits 9 quintillion dollars and then gets a note from the
banksaying his account is overdrawn...
 

I'm fairly sure that *none* of the money operations bother to check for
overflow; not only input, but arithmetic.  That falls somewhere between
bug and missing feature.  It's probably worth fixing but seems outside
the scope of the current patch.

In the meantime, I'm not sure whether the newly added functions should
be held to a higher standard than the existing ones.  It might be better
to leave it be, and plan to fix them all at once in a consistent style.
        regards, tom lane


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: Uppercase SGML entity declarations
Следующее
От: Robert Haas
Дата:
Сообщение: Re: cast from integer to money