Re: maximum digits for NUMERIC

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: maximum digits for NUMERIC
Дата
Msg-id 201104261558.p3QFwJP20006@momjian.us
обсуждение исходный текст
Ответ на Re: maximum digits for NUMERIC  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: maximum digits for NUMERIC  (Alvaro Herrera <alvherre@commandprompt.com>)
Список 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 по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: Sync Rep v19
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Bad COMPACT_ALLOC_CHUNK size in tsearch/spell.c?