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

From Tom Lane
Subject Re: pgsql-server/src backend/utils/adt/numutils.c ...
Date
Msg-id 17984.1030512389@sss.pgh.pa.us
Whole thread Raw
In response to Re: pgsql-server/src backend/utils/adt/numutils.c ...  (Bruce Momjian <pgman@candle.pha.pa.us>)
List 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 by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: pgsql-server/src backend/utils/adt/numutils.c ...
Next
From: momjian@postgresql.org (Bruce Momjian - CVS)
Date:
Subject: pgsql-server/ oc/src/sgml/sql.sgml oc/src/sgml ...