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 03:57:41
Message-ID: 000301bf7ce8$f77bb600$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:
> > 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(at)tpf(dot)co(dot)jp

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2000-02-22 04:05:49 Re: [HACKERS] Numeric with '-'
Previous Message Tom Lane 2000-02-22 03:56:34 Re: [HACKERS] Re: [PATCHES] Patch for more readable parse error messages