Re: reducing NUMERIC size for 9.1

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: reducing NUMERIC size for 9.1
Date: 2010-07-30 13:16:45
Message-ID: 24562.1280495805@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Robert Haas <robertmhaas(at)gmail(dot)com> writes:
> On Fri, Jul 30, 2010 at 1:13 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> 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.

Ah, I see. Maybe we should allow for one more NumericDigit in the
calculation for such cases. I guess you could look at the scale too
to detect if the case is possible, but not sure it's worth the trouble.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2010-07-30 13:45:30 Re: patch for check constraints using multiple inheritance
Previous Message Tom Lane 2010-07-30 13:13:58 Re: ERROR: argument to pg_get_expr() must come from system catalogs