change type from NUMERIC(14,4) to NUMERIC(24,12)

From: Torsten Förtsch <tfoertsch123(at)gmail(dot)com>
To: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: change type from NUMERIC(14,4) to NUMERIC(24,12)
Date: 2017-01-24 09:53:55
Message-ID: CAKkG4_nN5b_ktJS1Y3aZwxNn8KFvYKPOvW1Q6L+cybf4YD9X=g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

we have a large table and want to change the type of one column
from NUMERIC(14,4) to NUMERIC(24,12). If the new type is just NUMERIC
without any boundaries, the operation is fast. If (24,12) is specified, it
takes ages.

I think it takes so long because the database wants to check that all data
in the table is compatible with the new type. But the old type has stricter
boundaries both before and after the dot. So, it is compatible. It has to
be.

Is there a way to change the type skipping the additional check?

This is 9.6.

Thanks,
Torsten

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Albe Laurenz 2017-01-24 10:48:51 Re: change type from NUMERIC(14,4) to NUMERIC(24,12)
Previous Message Simon Riggs 2017-01-24 09:08:01 Re: Detailed progress reporting for "vacuuming indexes" stage