Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-bugs by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group