Re: [HACKERS] numeric & decimal

From: jwieck(at)debis(dot)com (Jan Wieck)
To: lockhart(at)alumni(dot)caltech(dot)edu (Thomas Lockhart)
Cc: jwieck(at)debis(dot)com, maillist(at)candle(dot)pha(dot)pa(dot)us, jose(at)sferacarta(dot)com, pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] numeric & decimal
Date: 1999-05-10 18:27:27
Message-ID: m10gulz-000EBXC@orion.SAPserv.Hamburg.dsh.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
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(at)debis(dot)com (Jan Wieck) #

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 1999-05-10 18:28:22 Re: [HACKERS] inet data type regression test fails
Previous Message Bruce Momjian 1999-05-10 18:26:40 Re: [HACKERS] Oops, I seem to have changed UNION's behavior