Re: monetary bug

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Mahmoud Taghizadeh <m_taghi(at)yahoo(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: monetary bug
Date: 2004-08-22 17:29:14
Message-ID: 6152.1093195754@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Mahmoud Taghizadeh <m_taghi(at)yahoo(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2004-08-22 17:53:32 Re: pg_hba.conf and IP-MASK
Previous Message Tom Lane 2004-08-22 16:52:18 Re: pg_hba.conf and IP-MASK