Numeric with '-' - Mailing list pgsql-hackers

From Hiroshi Inoue
Subject Numeric with '-'
Date
Msg-id 000401bf7c3a$1fec7200$2801007e@tpf.co.jp
Whole thread Raw
Responses Re: [HACKERS] Numeric with '-'  (Brian Hirt <bhirt@mobygames.com>)
Re: [HACKERS] Numeric with '-'  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
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


pgsql-hackers by date:

Previous
From: Chris Bitmead
Date:
Subject: Re: [HACKERS] Re: [PATCHES] Patch for more readable parse error messages
Next
From: Brian Hirt
Date:
Subject: Re: [HACKERS] Numeric with '-'