Re: [HACKERS] numeric & decimal

Jan Wieck <jwieck@debis.com>

From: jwieck@debis.com (Jan Wieck)
To: maillist@candle.pha.pa.us (Bruce Momjian)
Cc: jose@sferacarta.com, jwieck@debis.com, pgsql-hackers@postgreSQL.org
Date: 1999-05-10T16:51:02Z
Lists: 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) #