Hi,
I got this message. Is that because the string id too long ??
Where is the String length defined ??
thanks,
Kathy
insert into test (testid)
values('FAKEJOBMGRNAMEJOBNAME-020031016211324.144-06002elID--0jobname-0Thu Oct16
21:13:24 MDT 2003');
ERROR: pg_atoi: error in
"FAKEJOBMGRNAMEJOBNAM
On Thu, 16 Oct 2003, Kathy Zhu wrote:
> Hi,
>
> I got this message. Is that because the string id too long ??
Are you sure testid is defined as a string type and not an integer?
That'd be the most likely reason for pg_atoi to be called.
> insert into test (testid)
> values('FAKEJOBMGRNAMEJOBNAME
never mind, it was the wrong type.
sorry,
> X-Original-To: [EMAIL PROTECTED]
> Date: Thu, 16 Oct 2003 21:21:41 -0600 (MDT)
> From: Kathy Zhu <[EMAIL PROTECTED]>
> Subject: [GENERAL] pg_atoi
> To: [EMAIL PROTECTED]
> X-Virus-Scanned: by amavisd-new at postgresql.org
>
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) /* str
Richard Harvey Chapman <[EMAIL PROTECTED]> writes:
> 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.
Because that's what it ought to do, if you ask me ;-).
"109 foo" is not a valid integer