RE: [HACKERS] Numeric with '-'

Поиск
Список
Период
Сортировка
От Hiroshi Inoue
Тема RE: [HACKERS] Numeric with '-'
Дата
Msg-id 000001bf7cd2$17e01100$2801007e@tpf.co.jp
обсуждение исходный текст
Ответ на Re: [HACKERS] Numeric with '-'  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: [HACKERS] Numeric with '-'
Список 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 по дате отправления: