Re: to_number behavior change between 8.1 and 8.2

From: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
To: Richard Greenwood <richard(dot)greenwood(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: to_number behavior change between 8.1 and 8.2
Date: 2007-05-16 18:05:21
Message-ID: 464B47E1.6070503@commandprompt.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Richard Greenwood wrote:
> I am getting an error from to_number() in PostgreSQL 8.2 that does not
> occur in 8.1:
> invalid input syntax for type numeric: " "
> I assume that it is rejecting spaces, so I tried trimming with:
> to_number(trim (both ' ' from streetnum),'999999999')
> but still get the same error.

In 8.2 we no longer accept anything but valid numbers for numbers :). ""
is not a valid number.

The way around this is to change "" to NULL .

Sincerely,

Joshua D. Drake

>
> Any suggestions?
>
> Thanks,
> Rich
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ron Mayer 2007-05-16 18:34:36 Re: stats collector spins my disk up every 500ms (8.2.3)
Previous Message marcelo Cortez 2007-05-16 18:04:36 Re: dns less connection