Re: pgsql-server/src backend/utils/adt/numutils.c ...

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: pgsql-server/src backend/utils/adt/numutils.c ...
Дата
Msg-id 17984.1030512389@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: pgsql-server/src backend/utils/adt/numutils.c ...  (Bruce Momjian <pgman@candle.pha.pa.us>)
Список pgsql-committers
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> Tom Lane wrote:
>> It was certainly never documented as something that would work, unless
>> you chanced to read the one comment in numutils.c.  A normal person
>> would not expect an empty string to be taken as a valid representation
>> of "zero".

> Well, assuming we are matching atoi, it would make sense to return 0 for
> '', I think.

If we wanted to match atoi, we'd use atoi.  pg_atoi exists to provide
more bulletproof behavior --- such as detecting overflow and invalid
input and erroring out when it happens.

            regards, tom lane

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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: pgsql-server/src backend/utils/adt/numutils.c ...
Следующее
От: momjian@postgresql.org (Bruce Momjian - CVS)
Дата:
Сообщение: pgsql-server/ oc/src/sgml/sql.sgml oc/src/sgml ...