Re: [HACKERS] numeric & decimal

Jan Wieck <jwieck@debis.com>

From: jwieck@debis.com (Jan Wieck)
To: lockhart@alumni.caltech.edu (Thomas Lockhart)
Cc: jwieck@debis.com, maillist@candle.pha.pa.us, jose@sferacarta.com, pgsql-hackers@postgreSQL.org
Date: 1999-05-10T18:27:27Z
Lists: 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) #