money type overflow checks

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема money type overflow checks
Дата
Msg-id fb75784f-77ce-e6a7-fa74-922c73cfd93e@2ndquadrant.com
обсуждение исходный текст
Ответы Re: money type overflow checks  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
The input function of the money type has no overflow checks:

=> select '12345678901234567890'::money;
            money
-----------------------------
 -$13,639,628,150,831,692.72
(1 row)

The tests in the regression test file money.sql are bogus because they
only test the overflow checks of the bigint type before the cast.

Here is a patch that adds appropriate checks and tests.  We could
probably remove the bogus tests.

(Is checking for < 0 a valid overflow check?  We save the sign until the
very end, so it ought to work.  The code in int8.c works differently there.)

--
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Вложения

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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: Re: [COMMITTERS] pgsql: Prevent "snapshot too old" from trying to return pruned TOAST tu
Следующее
От: Robert Haas
Дата:
Сообщение: Re: Parallel tuplesort (for parallel B-Tree index creation)