Re: numeric_to_number() function skipping some digits - Mailing list pgsql-hackers

From Kevin Grittner
Subject Re: numeric_to_number() function skipping some digits
Date
Msg-id 4AC3A1CA020000250002B504@gw.wicourts.gov
Whole thread Raw
In response to Re: numeric_to_number() function skipping some digits  (daveg <daveg@sonic.net>)
Responses Re: numeric_to_number() function skipping some digits
List pgsql-hackers
daveg <daveg@sonic.net> wrote: 
> On Tue, Sep 22, 2009 at 10:27:19AM +0530, Jeevan Chalke wrote:
>> 
>> It seems that Oracle reads formatting string from right-to-left.
>> Here are few results:
>> ('number','format') ==> Oracle          PG
>> --------------------------------------------
>> ('34,50','999,99')  ==> 3450            340
>> ('34,50','99,99')   ==> 3450            3450
>> ('34,50','99,999')  ==> Invalid Number  3450
>> ('34,50','999,999') ==> Invalid Number  340
> 
> It seems worse to to give a wrong answer silently then to throw an
> error.  What we do now seems sort of MySqlish.
I agree with David on that.
Further, it seems to me that functions which are there only for Oracle
compatibility (i.e., they are not part of the SQL standard and are not
particularly sensible, but are popular in Oracle) should behave like
the corresponding Oracle function.  An argument could even be made for
"bug compatibility" for such functions, at least to some extent;
although we're not talking about that here -- the Oracle results seem
more sane than current PostgreSQL behavior..
-Kevin


pgsql-hackers by date:

Previous
From: Andrew Gierth
Date:
Subject: Re: latest hstore patch
Next
From: Tom Lane
Date:
Subject: Re: numeric_to_number() function skipping some digits