parse bug

Lists: pgsql-sql
From: floyds(at)4peakstech(dot)com
To: "Pgsql-Sql" <pgsql-sql(at)postgresql(dot)org>
Subject: parse bug
Date: 2002-11-11 19:25:16
Message-ID: NDBBKEGJICMIMJHJEBCOGEJEFMAA.floyds@4peakstech.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-sql


seems like an error in the sql parser to me:

# create table test (acol smallint[]);
CREATE
# insert into test (acol) values ('{ 0 }');
ERROR: pg_atoi: error in "0 ": can't parse " "
# insert into test (acol) values ('{ 0}');
INSERT 28472 1

the only difference is the trailing " " after the 0;

Regards,

Floyd Shackelford
4 Peaks Technology Group, Inc.
VOICE: 334.735.9428
FAX: 916.404.7125
EMAIL: FloydS(at)4PeaksTech(dot)com
ICQ #: 161371538

acta non verba


From: Achilleus Mantzios <achill(at)matrix(dot)gatewaynet(dot)com>
To: floyds(at)4peakstech(dot)com
Cc: Pgsql-Sql <pgsql-sql(at)postgresql(dot)org>
Subject: Re: parse bug
Date: 2002-11-12 14:10:02
Message-ID: Pine.LNX.4.44.0211121605110.9294-100000@matrix.gatewaynet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-sql

On Mon, 11 Nov 2002 floyds(at)4peakstech(dot)com wrote:

>
> seems like an error in the sql parser to me:
>
> # create table test (acol smallint[]);
> CREATE
> # insert into test (acol) values ('{ 0 }');
> ERROR: pg_atoi: error in "0 ": can't parse " "
> # insert into test (acol) values ('{ 0}');
> INSERT 28472 1
>
> the only difference is the trailing " " after the 0;

traditionally atoi ignores only leading spaces, so
insert into test (acol) values ('{ 0}');

should work too.

btw why do you need trailing spaces for??

>
>
> Regards,
>
> Floyd Shackelford
> 4 Peaks Technology Group, Inc.
> VOICE: 334.735.9428
> FAX: 916.404.7125
> EMAIL: FloydS(at)4PeaksTech(dot)com
> ICQ #: 161371538
>
> acta non verba
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> message can get through to the mailing list cleanly
>

==================================================================
Achilleus Mantzios
S/W Engineer
IT dept
Dynacom Tankers Mngmt
Nikis 4, Glyfada
Athens 16610
Greece
tel: +30-10-8981112
fax: +30-10-8981877
email: achill(at)matrix(dot)gatewaynet(dot)com
mantzios(at)softlab(dot)ece(dot)ntua(dot)gr