Re: to_number behavior change between 8.1 and 8.2 - Mailing list pgsql-general

From Joshua D. Drake
Subject Re: to_number behavior change between 8.1 and 8.2
Date
Msg-id 464B47E1.6070503@commandprompt.com
Whole thread Raw
In response to to_number behavior change between 8.1 and 8.2  ("Richard Greenwood" <richard.greenwood@gmail.com>)
Responses Re: to_number behavior change between 8.1 and 8.2
List 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
>


pgsql-general by date:

Previous
From: marcelo Cortez
Date:
Subject: Re: dns less connection
Next
From: Richard Huxton
Date:
Subject: Re: to_number behavior change between 8.1 and 8.2