Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)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