Skip site navigation (1) Skip section navigation (2)

Re: reducing NUMERIC size for 9.1

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: reducing NUMERIC size for 9.1
Date: 2010-07-30 11:22:51
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
On Fri, Jul 30, 2010 at 1:13 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Robert Haas <robertmhaas(at)gmail(dot)com> writes:
>> But, looking at it a bit more carefully, isn't the maximum-size logic
>> for numeric rather bogus?
> Perhaps, but I think you're confused on at least one point.
> numeric(2,1) has to be able to hold 2 decimal digits, not 2
> NumericDigits (which'd actually be 8 decimal digits given
> the current code).

I get that.  The point is: if one of those 2 decimal digits is before
the decimal point and the other is after it, then two NumericDigits
will be used.  The value '11'::numeric is only size 10 (untoasted),
but the value '1.1'::numeric is size 12 (untoasted).

Robert Haas
The Enterprise Postgres Company

In response to


pgsql-hackers by date

Next:From: Vincenzo RomanoDate: 2010-07-30 11:40:31
Subject: Re: On Scalability
Previous:From: Jan UrbaƄskiDate: 2010-07-30 11:02:32
Subject: Re: TwoPO: experimental join order algorithm

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group