Re: select to_number('1,000', '999,999');

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: David Schweikert <dws(at)ee(dot)ethz(dot)ch>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: select to_number('1,000', '999,999');
Date: 2004-11-22 01:10:08
Message-ID: 1926.1101085808@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox
Thread:
Lists: pgsql-bugs

David Schweikert <dws(at)ee(dot)ethz(dot)ch> writes:
> select to_number('1,000', '999,999') returns '100'.

I'm not entirely convinced this is a bug. I get the right answer from

regression=# select to_number('001,000', '999,999') ;
to_number
-----------
1000
(1 row)

It's arguable that to_number() should throw an error when the input
doesn't match the format, but right now it doesn't ...

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Nicola Pero 2004-11-22 04:34:22 Data corruption/loss when altering tables
Previous Message Michael Fuhr 2004-11-21 08:32:12 Re: plperl: Undefined subroutine &main::mksafefunc