Re: monetary bug

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: monetary bug
Дата
Msg-id 6152.1093195754@sss.pgh.pa.us
обсуждение исходный текст
Ответ на monetary bug  (Mahmoud Taghizadeh <m_taghi@yahoo.com>)
Ответы Re: monetary bug  (Mike Mascari <mascarm@mascari.com>)
Re: monetary bug  ("D'Arcy J.M. Cain" <darcy@druid.net>)
Список pgsql-hackers
Mahmoud Taghizadeh <m_taghi@yahoo.com> writes:
> a dirty method to fix this bug is to replace following
> line 
> if (isdigit((unsigned char) *s) && dec < fpoint )
> with 
> if (isdigit((unsigned char) *s) && ((dec < fpoint) ||
> fpoint == 0))

This patch is wrong.  Something involving "!seen_dot || dec < fpoint"
would probably be better.  On the other hand, I can see half a dozen
other brokennesses in that routine on idly glancing over it :-(

Are you aware that the monetary type is deprecated and is going to be
dropped entirely pretty soon?  I would not recommend that you spend
any time on it, unless you want to commit to doing a wholesale rewrite.
Store your financial data in NUMERIC columns instead --- no overflow
worries, for one thing.
        regards, tom lane


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: pg_hba.conf and IP-MASK
Следующее
От: "Andrew Dunstan"
Дата:
Сообщение: Re: pg_hba.conf and IP-MASK