Re: [HACKERS] numeric & decimal - Mailing list pgsql-hackers

From jwieck@debis.com (Jan Wieck)
Subject Re: [HACKERS] numeric & decimal
Date
Msg-id m10gtGg-000EBXC@orion.SAPserv.Hamburg.dsh.de
Whole thread Raw
In response to Re: [HACKERS] numeric & decimal  (Bruce Momjian <maillist@candle.pha.pa.us>)
Responses Re: [HACKERS] numeric & decimal  (jwieck@debis.com (Jan Wieck))
List pgsql-hackers
Bruce Momjian wrote:
>
>
> This looks like something that should be addressed.  Was it?
>
>
>
> > >     For  some reason (dunno why) the parser ignores the precision
> > >     for DECIMAL.  atttypmod is set hardcoded to -1.  So the above
> > >     is identical to a
> > >
> > >         CREATE TABLE test (n numeric(10,3), d decimal);
> > >
> > >     I'll  test  what  happens  if I enable it in gram.y and if it
> > >     doesn't break any regression commit the changes.

    This  one  is  fixed.  Parser  handles  precision  of DECIMAL
    already.

> >   NUMERIC  without size is interpreted as NUMERIC(x,6). Why ?
> >   Standard SQL92 says that NUMERIC without size is equivalent to NUMERIC(1)

    PostgreSQL specific. Should I change it to standard?

> >
> > - NUMERIC(4,1)  transalte value -999.99 as -1000.0 (greater than his size)

    Definitely a bug. The value is checked before  the  rounding.
    Will fix it soon.


Jan

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.                                  #
#======================================== jwieck@debis.com (Jan Wieck) #

pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] It would be nice if this could be fixed...
Next
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] GROUP BY fixes committed