Re: maximum digits for NUMERIC - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: maximum digits for NUMERIC
Date
Msg-id 201104261558.p3QFwJP20006@momjian.us
Whole thread Raw
In response to Re: maximum digits for NUMERIC  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: maximum digits for NUMERIC
List pgsql-hackers
Robert Haas wrote:
> On Fri, Apr 1, 2011 at 7:51 AM, Noah Misch <noah@leadboat.com> wrote:
> > On Fri, Apr 01, 2011 at 11:44:23AM +0100, Gianni Ciolli wrote:
> >> Please find attached v2 of the numeric-doc patch, which takes into
> >> account your remarks. In particular, numeric limits are now correct
> >> and documented only in that table.
> >
> > This version looks sound to me. ?Thank you.
>
> Committed.

Wow, I am so glad someone documented this.  I often do factorial(4000)
which generates 12673 digits when teaching classes, and it bugged me
that we documented the limit as 1000 digits.  I had asked about
improving the docs years ago and was discouraged because people thought
we might someday want to limit the length to 1000.  Do we want to bump
up that specified limit?

The attached, applied patch clarifies that it is non-precision-specified
NUMERIC that has a very high range.

--
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + It's impossible for everything to be true. +
diff --git a/doc/src/sgml/datatype.sgml b/doc/src/sgml/datatype.sgml
new file mode 100644
index 13b888d..74408b0
*** a/doc/src/sgml/datatype.sgml
--- b/doc/src/sgml/datatype.sgml
*************** NUMERIC
*** 529,536 ****
       <para>
        The maximum allowed precision when explicitely specified in the
        type declaration is 1000; otherwise the current implementation
!       of the <type>NUMERIC</type> is subject to the limits described
!       in <xref linkend="datatype-numeric-table">.
       </para>
      </note>

--- 529,537 ----
       <para>
        The maximum allowed precision when explicitely specified in the
        type declaration is 1000; otherwise the current implementation
!       of <type>NUMERIC</type> (when the precision is not specified)
!       is subject to the limits described in <xref
!       linkend="datatype-numeric-table">.
       </para>
      </note>


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Sync Rep v19
Next
From: Tom Lane
Date:
Subject: Re: Bad COMPACT_ALLOC_CHUNK size in tsearch/spell.c?