Re: Unnexpected results using to_number()

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Andrew Snow" <andrew(at)modulus(dot)org>
Cc: pgsql-bugs(at)postgresql(dot)org, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Unnexpected results using to_number()
Date: 2000-07-09 17:38:52
Message-ID: 29058.963164332@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

"Andrew Snow" <andrew(at)modulus(dot)org> writes:
> # SELECT to_number('12,454.8-', '');
> pqReadData() -- backend closed the channel unexpectedly.

In current sources I get a NULL result, which seems to be what the
code author intended originally. However this seems a little bit
inconsistent --- shouldn't it raise a bad-format error instead?
For example,

regression=# SELECT to_number('12,454.8-', ' ');
ERROR: Bad numeric input format ' '

Seems odd that no spaces means "return NULL" but 1 or more spaces
doesn't.

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2000-07-09 17:44:26 Re: Periodic freezing of backend processes
Previous Message Robert B. Easter 2000-07-09 13:01:54 INITIALLY DEFERRED / UPDATE in transaction bug

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2000-07-09 17:57:40 Re: Bug list?
Previous Message Tom Lane 2000-07-09 17:25:43 Re: C language function dump problem