Re: to_number behavior change between 8.1 and 8.2

Поиск
Список
Период
Сортировка
От Joshua D. Drake
Тема Re: to_number behavior change between 8.1 and 8.2
Дата
Msg-id 464B47E1.6070503@commandprompt.com
обсуждение исходный текст
Ответ на to_number behavior change between 8.1 and 8.2  ("Richard Greenwood" <richard.greenwood@gmail.com>)
Ответы Re: to_number behavior change between 8.1 and 8.2  ("Richard Greenwood" <richard.greenwood@gmail.com>)
Список 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 по дате отправления:

Предыдущее
От: marcelo Cortez
Дата:
Сообщение: Re: dns less connection
Следующее
От: Richard Huxton
Дата:
Сообщение: Re: to_number behavior change between 8.1 and 8.2