Re: Is it necessary to rewrite table while increasing the scale of datatype numeric???

From: Noah Misch <noah(at)leadboat(dot)com>
To: wangshuo(at)highgo(dot)com(dot)cn
Cc: Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Is it necessary to rewrite table while increasing the scale of datatype numeric???
Date: 2013-09-04 11:30:52
Message-ID: 20130904113052.GA135734@tornado.leadboat.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Sep 04, 2013 at 12:08:48PM +0800, wangshuo(at)highgo(dot)com(dot)cn wrote:
> I find that it takes a long time when I increase the scale of a numeric
> datatype.
> By checking the code, I found that's because it needs to rewrite that
> table's file.
> After checking that table's data file, I found only parameter n_header
> changed.
> And, I found the data in that numeric field never changed.
> So I thank It's not necessary to rewrite the table's file in this case.

n_header is part of the numeric field's data. That's not just pedantry: the
display scale stored in n_header affects how numeric_out() formats the value.

--
Noah Misch
EnterpriseDB http://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Stephen Frost 2013-09-04 12:13:17 Re: [rfc] overhauling pgstat.stat
Previous Message MauMau 2013-09-04 10:10:00 Re: [9.3 doc fix] clarification of Solaris versions