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
Ответ на
Список
Дерево обсуждения
pgsql-server/src backend/utils/adt/numutils.c ... momjian@postgresql.org (Bruce Momjian - CVS)
Re: pgsql-server/src backend/utils/adt/numutils.c ... Neil Conway <neilc@samurai.com>
Re: pgsql-server/src backend/utils/adt/numutils.c ... Tom Lane <tgl@sss.pgh.pa.us>
Re: pgsql-server/src backend/utils/adt/numutils.c ... Bruce Momjian <pgman@candle.pha.pa.us>
Re: pgsql-server/src backend/utils/adt/numutils.c ... Neil Conway <neilc@samurai.com>
Re: pgsql-server/src backend/utils/adt/numutils.c ... Bruce Momjian <pgman@candle.pha.pa.us>
Re: pgsql-server/src backend/utils/adt/numutils.c ... Tom Lane <tgl@sss.pgh.pa.us>
Re: pgsql-server/src backend/utils/adt/numutils.c ... Bruce Momjian <pgman@candle.pha.pa.us>
Re: pgsql-server/src backend/utils/adt/numutils.c ... Tom Lane <tgl@sss.pgh.pa.us>
Bruce Momjian  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
Дата:
От: momjian@postgresql.org (Bruce Momjian - CVS)
Дата:
FAQ