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

From Hiroshi Inoue
Subject RE: [HACKERS] Numeric with '-'
Date
Msg-id 000301bf7ce8$f77bb600$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:
> > Hmm,this may be worse than before.
> > INSERT/UPDATE statements would lose precision without
> > telling any error/warnings.
> 
> They didn't give any such warning before, either.  I doubt I've
> made anything worse.
>

Before your change
INSERT into t (numdata) values (-1234567890.1234567);
caused an error
ERROR:  Unable to convert left operator '-' from type 'unknown'.
but currently inserts a constant -1234567890.12346.
and
INSERT into t (numdata) values (1234567890.1234567);
inserted a numeric constant 1234567890.1234567 precisely
but currently inserts a constant 1234567890.12346.

> > Shouldn't decimal constants be distinguished from real constants ?
> 
> Why?  I don't see any particularly good reason for distinguishing
> 1234567890.1234567890 from 1.2345678901234567890e9.  (numeric_in
> does accept both these days, BTW.)
>

According to a book about SQL92 which I have,SQL92 seems to
recommend it.

Hiroshi Inoue
Inoue@tpf.co.jp 


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [HACKERS] Numeric with '-'
Next
From: Tom Lane
Date:
Subject: Re: [HACKERS] Re: [PATCHES] Patch for more readable parse error messages