Re: pg_atoi()

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: pg_atoi()
Дата
Msg-id 18065.962243532@sss.pgh.pa.us
обсуждение исходный текст
Ответ на pg_atoi()  (Richard Harvey Chapman <hchapman@3gfp.com>)
Список pgsql-general
Richard Harvey Chapman <hchapman@3gfp.com> writes:
> Is there a reason why pg_atoi() was programmed to fail if the entire
> input string is not valid?
> i.e. "109" yields 109, but "109 apples" yields an error.

Because that's what it ought to do, if you ask me ;-).
"109 foo" is not a valid integer value.  If you want your app to
accept such things, do your own input parsing and filtering.
A database server should not be lax about what it considers valid
data.

            regards, tom lane

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Re[2]: Restricting queries by the presence of a WHERE clause
Следующее
От: Richard Harvey Chapman
Дата:
Сообщение: Comments with embedded single quotes