RE: [HACKERS] Numeric with '-'

From: "Hiroshi Inoue" <Inoue(at)tpf(dot)co(dot)jp>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "pgsql-hackers" <pgsql-hackers(at)postgreSQL(dot)org>
Subject: RE: [HACKERS] Numeric with '-'
Date: 2000-02-22 01:13:57
Message-ID: 000001bf7cd2$17e01100$2801007e@tpf.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> -----Original Message-----
> From: Tom Lane [mailto:tgl(at)sss(dot)pgh(dot)pa(dot)us]
>
> "Hiroshi Inoue" <Inoue(at)tpf(dot)co(dot)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(at)tpf(dot)co(dot)jp

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tatsuo Ishii 2000-02-22 01:47:57 Re: [HACKERS] pg_ctl man page
Previous Message Bruce Momjian 2000-02-22 00:57:36 Re: [HACKERS] Beta for 4:30AST ... ?