monetary bug

From: Mahmoud Taghizadeh <m_taghi(at)yahoo(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: monetary bug
Date: 2004-08-22 11:50:33
Message-ID: 20040822115033.96353.qmail@web50710.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I found a little bug in monetary function of
postgresql function cash_in in file cash.c
the problem is that when I run
set lc_monetary to "fa_IR.UTF8"
and try to insert a value to a field with type of
money, I got the following error:
"invalid input syntax for type money: "1000"

at the same time when I run "set lc_monetary to
"en_US.UTF8", everythings worked well.

I studied the source code and I found that cash.c has
a little problem to handling money type. I found that
this bug exists for all of countries that have not
precision for their money.

I decided to write a patch for this bug, but before I
start my work, i want to know if anyone has any idea
about this bug or not?

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))

M, Taghizade
Regards

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Mahmoud Taghizadeh 2004-08-22 11:53:54 NLS support for postgreSQL
Previous Message Shachar Shemesh 2004-08-22 11:09:38 Compilation problems and extension on Windows