Re: Numeric overflow problem + patch

Поиск
Список
Период
Сортировка
Искать
От
David Fetter
Тема
Re: Numeric overflow problem + patch
Дата
Msg-id
20060928211910.GI22129@fetter.org
Ответ на
Список
Дерево обсуждения
Numeric overflow problem + patch David Fetter <david@fetter.org>
Re: Numeric overflow problem + patch Tom Lane <tgl@sss.pgh.pa.us>
Re: Numeric overflow problem + patch Martijn van Oosterhout <kleptog@svana.org>
Re: Numeric overflow problem + patch David Fetter <david@fetter.org>
Re: Numeric overflow problem + patch David Fetter <david@fetter.org>
Re: Numeric overflow problem + patch Bruce Momjian <bruce@momjian.us>
Re: Numeric overflow problem + patch David Fetter <david@fetter.org>
On Thu, Sep 28, 2006 at 05:11:43PM -0400, Tom Lane wrote:
> David Fetter  writes:
> > ! DETAIL:  A field with precision 4, scale 4 must have an absolute value less than 1.
> > [ becomes ]
> > ! DETAIL:  A field with precision 4, scale 4 must have an absolute value less than 1 - 5 * 10^-5.
> 
> This strikes me as overly pedantic.  The message needs to be clear,
> and the proposed change will just confuse people.

It might, but the error that's currently in there is wrong.  With the
patch applied, you get:

postgres=# SELECT .99995::NUMERIC(4,4);
ERROR:  numeric field overflow
DETAIL:  A field with precision 4, scale 4 must have an absolute value less than 1 - 5 * 10^-5.

postgres=# SELECT .9999499999999999999999999999::NUMERIC(4,4);
 numeric
---------
  0.9999
(1 row)

I'd thought of changing it to the corresponding numeric piece, but
this doesn't work so well for NUMERIC(16,8) and the like.

Cheers,
D
-- 
David Fetter  http://fetter.org/
phone: +1 415 235 3778        AIM: dfetter666
                              Skype: davidfetter

Remember to vote!
В списке pgsql-hackers по дате отправления
От: D'Arcy J.M. Cain
Дата:
Сообщение: Re: New version of money type
От: David Fetter
Дата:
FAQ