Re: BUG #3506: to_number silently ignore characters

Поиск
Список
Период
Сортировка
От Laurent Martelli
Тема Re: BUG #3506: to_number silently ignore characters
Дата
Msg-id 46B2E1A3.2080104@seditel.fr
обсуждение исходный текст
Ответ на Re: BUG #3506: to_number silently ignore characters  (Heikki Linnakangas <heikki@enterprisedb.com>)
Ответы Re: BUG #3506: to_number silently ignore characters  ("William Leite Araújo" <william.bh@gmail.com>)
Список pgsql-bugs
Heikki Linnakangas a écrit :
> Laurent Martelli wrote:
>> to_number('123.0','999999') returns 1230, at least on version 7.4 and 8.1. I
>> think it should return 123 or raise an error.
>
> to_number will silently ignore any character that doesn't match the
> pattern. That can be confusing, and not generally a very bright idea in
> applications, but we can't really change the behavior because that could
> break existing applications.

OK. I'm tempted to say that since this is not specified in the
documentation, applications should not rely on this behaviour. But I
understand you will not to break existing applications, so perhaps you
could add a function that would behave in a more expected manner, or at
least document precisely the current behaviour in the documentation.

Best regards,
Laurent

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: BUG #3504: Some listening sessions never return from writing, problems ensue
Следующее
От: Казорез Александр Олегович
Дата:
Сообщение: Bug Pgsql