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

From jwieck@debis.com (Jan Wieck)
Subject Re: [HACKERS] numeric & decimal
Date
Msg-id m10gulz-000EBXC@orion.SAPserv.Hamburg.dsh.de
Whole thread Raw
In response to Re: [HACKERS] numeric & decimal  (Thomas Lockhart <lockhart@alumni.caltech.edu>)
List pgsql-hackers
>
> > > > 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?
>
> The standard (per Date's book) is:
>
>   NUMERIC == NUMERIC(p), where p is implementation-defined.
>   NUMERIC(p) == NUMERIC(p,0)
>
> Date also explicitly says that:
>
>   "The following are implementation-defined:
>   ...
>   o The default precision for NUMERIC and DECIMAL if there is no
>     declared precision
>   ..."
>
> So where did NUMERIC(1) come from? afaict Jan should use what he feels
> are reasonable values...

    The  default  for  NUMERIC  is  NUMERIC(30,6).  NUMERIC(n) is
    treated as NUMERIC(n,0). So it is exactly as  Date  says  and
    since  it  is  already  released,  nothing  to  get changed -
    period.

    If someone want's his  installation  to  act  different,  the
    place     to     do    it    is    include/numeric.h    where
    NUMERIC_DEFAULT_PRECISION  and  NUMERIC_DEFAULT_SCALE  define
    the two values.


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] inet data type regression test fails
Next
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] GROUP BY fixes committed