Re: [HACKERS] Numeric with '-' - Mailing list pgsql-hackers

From Brian Hirt
Subject Re: [HACKERS] Numeric with '-'
Date
Msg-id 20000221015437.A356@loopy.berkhirt.com
Whole thread Raw
In response to Numeric with '-'  ("Hiroshi Inoue" <Inoue@tpf.co.jp>)
Responses RE: [HACKERS] Numeric with '-'
Re: [HACKERS] Numeric with '-'
List pgsql-hackers
A strange thing I noticed with this is that

"select -234567890.1234567;" works and
"select -1234567890.123456;" also works while
"select -1234567890.1234567;" does not.  That
extra character just seems to push things over
the edge.

It almost seems like there is some sort of length
restriction somewhere in the parser.

On Mon, Feb 21, 2000 at 04:06:07PM +0900, Hiroshi Inoue wrote:
> Hi,
> 
> The following phenomenon was reported to pgsql-jp(ML in Japan).
> 
> rest=# select -1234567890.1234567;
> ERROR:  Unable to convert left operator '-' from type 'unknown'
> 
> -1234567890.1234567 is treated as - '1234567890.1234567'
> as the following comment in scan.l says.
> 
>  /* we no longer allow unary minus in numbers.
>  * instead we pass it separately to parser. there it gets
>  * coerced via doNegate() -- Leon aug 20 1999
>  */
> 
> However doNegate() does nothing for SCONST('1234567890.1234567').
> I don't understand where or how to combine '-' and numeric SCONST.
> 
> Regards.
> 
> Hiroshi Inoue
> Inoue@tpf.co.jp
> 
> ************

-- 
The world's most ambitious and comprehensive PC game database project.
                     http://www.mobygames.com


pgsql-hackers by date:

Previous
From: "Hiroshi Inoue"
Date:
Subject: Numeric with '-'
Next
From: "Hiroshi Inoue"
Date:
Subject: RE: [HACKERS] Numeric with '-'