Re: maximum digits for NUMERIC

Поиск
Список
Период
Сортировка
От Gianni Ciolli
Тема Re: maximum digits for NUMERIC
Дата
Msg-id 20110325180954.GA17471@albo.gi.lan
обсуждение исходный текст
Ответ на Re: maximum digits for NUMERIC  (Gianni Ciolli <gianni.ciolli@2ndquadrant.it>)
Ответы Re: maximum digits for NUMERIC
Список pgsql-hackers
On Fri, Mar 25, 2011 at 08:46:17AM +0000, Gianni Ciolli wrote:
> On Sun, Mar 20, 2011 at 08:14:21PM -0400, Noah Misch wrote:
> > Agreed.  The documentation is suggestive of this limit:
> >
> > # CREATE TABLE n (c numeric(1001,0));
> > ERROR:  NUMERIC precision 1001 must be between 1 and 1000
> > LINE 1: CREATE TABLE n (c numeric(1001,0));
> >
> > However, that's indeed just a limit of the numeric typmod representation, not
> > the data type itself.  An unqualified "numeric" column hits no such limit.
>
> For the record, the limits I found from my tests are:
> * 2^17 - 1 maximum total digits
> * 2^14 - 1 maximum fractional digits
>
> (I did tests as I couldn't extract any obvious limit from the source
> code of numeric.c)

The attached patch resumes this short discussion.

Best regards,
Dr. Gianni Ciolli - 2ndQuadrant Italia
PostgreSQL Training, Services and Support
gianni.ciolli@2ndquadrant.it | www.2ndquadrant.it

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Transactional DDL, but not Serializable
Следующее
От: Darren Duncan
Дата:
Сообщение: Re: Transactional DDL, but not Serializable