pg_atoi()

Поиск
Список
Период
Сортировка
От Richard Harvey Chapman
Тема pg_atoi()
Дата
Msg-id Pine.LNX.4.10.10006281803050.18540-100000@smile.3gfp.com
обсуждение исходный текст
Ответы Re: pg_atoi()
Список pgsql-general
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.

Snippet from pg_atoi() in src/backend/utils/adt/numutils.c:

        l = strtol(s, &badp, 10);

        if (errno)                       /* strtol must set ERANGE */
                elog(ERROR, "pg_atoi: error reading \"%s\": %m", s);
        if (badp && *badp && (*badp != c))
                elog(ERROR, "pg_atoi: error in \"%s\": can\'t parse
\"%s\"", s, badp);


Thanks,

R.



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

Предыдущее
От: Lincoln Yeoh
Дата:
Сообщение: Re: Re[2]: Restricting queries by the presence of a WHERE clause
Следующее
От: Charles Tassell
Дата:
Сообщение: Re: Interface Question