Re: cast from integer to money

Поиск
Список
Период
Сортировка
От Joseph Adams
Тема Re: cast from integer to money
Дата
Msg-id BANLkTinwYmXMWwL3VdnHudeJs9H7QUnfVw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: cast from integer to money  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: cast from integer to money  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
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:
>
> rhaas=# select 9223372036854775807::money;
>  money
> --------
>  -$1.00
> (1 row)

cash_in doesn't test for overflow, either (tested on 8.4.0, 9.0.3, and HEAD):

joey=# select '9223372036854775807'::money;money
---------$1.00
(1 row)

Is this a bug?

Detail: unlike cash_in, numeric_cash does check for overflow
(implicitly, through its use of numeric_int8).


Joey Adams


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: cast from integer to money
Следующее
От: Mike Fowler
Дата:
Сообщение: Re: PG 9.0.3. How to select rows from xml