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

From Hiroshi Inoue
Subject RE: [HACKERS] Numeric with '-'
Date
Msg-id 000001bf7cd2$17e01100$2801007e@tpf.co.jp
Whole thread Raw
In response to Re: [HACKERS] Numeric with '-'  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [HACKERS] Numeric with '-'
List pgsql-hackers
> -----Original Message-----
> From: Tom Lane [mailto:tgl@sss.pgh.pa.us]
> 
> "Hiroshi Inoue" <Inoue@tpf.co.jp> writes:
> > The following phenomenon was reported to pgsql-jp(ML in Japan).
> 
> > rest=# select -1234567890.1234567;
> > ERROR:  Unable to convert left operator '-' from type 'unknown'
> 
> I've committed fixes that make the parser treat numeric literals
> the same no matter how many digits they have.  With current sources,
> 
> regression=# select -1234567890.1234567;
>      ?column?
> -------------------
>  -1234567890.12346
> (1 row)
> 
> which is probably still not what you want,

Hmm,this may be worse than before.
INSERT/UPDATE statements would lose precision without
telling any error/warnings.

> because the default
> type for a non-integer literal is float8 in the absence of any
> context to clue the system otherwise, so you lose precision.
> You can do
>

Shouldn't decimal constants be distinguished from real constants ?
For example, decimal --> NCONST -> T_Numreic Value -> 
Const node of type NUMERICOID .... 

Comments ? 
Regards.

Hiroshi Inoue
Inoue@tpf.co.jp


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] Beta for 4:30AST ... ?
Next
From: Tatsuo Ishii
Date:
Subject: Re: [HACKERS] pg_ctl man page