Re: numeric_to_number() function skipping some digits

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jeevan Chalke <jeevan(dot)chalke(at)enterprisedb(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: numeric_to_number() function skipping some digits
Date: 2009-09-18 15:25:59
Message-ID: 24897.1253287559@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Jeevan Chalke <jeevan(dot)chalke(at)enterprisedb(dot)com> writes:
> With PG84, I have tried something like this which seem incorrect to me.

> # SELECT '' AS to_number_2, to_number('-347,58', '99G999');

Well, the input doesn't actually match the format, so I'm not totally
excited about this. You do get sane results from:

regression=# select to_number('-347,58', '999G99');
to_number
-----------
-34758
(1 row)

Should we have it throw an error if the input corresponding to a G
symbol doesn't match the expected group separator? I'm concerned that
that would break applications that work okay today.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2009-09-18 15:43:04 Re: Hot Standby 0.2.1
Previous Message David Fetter 2009-09-18 15:16:31 Re: happy birthday Tom Lane ...