Do you really need to migrate your NUMERIC and DECIMAL Data Types?
From InterBase
Go Up to About NUMERIC and DECIMAL Data Types
As you migrate your databases to dialect 3, consider the following questions about columns defined with NUMERIC
and DECIMAL
data types:
- Is the precision less than 10? If so, there is no issue. You can migrate without taking any action and there will be no change in the database and no effect on clients.
- For
NUMERIC
andDECIMAL
columns with precision greater than 9, isDOUBLE PRECISION
an appropriate way to store your data?
- In many cases, the answer is “yes.” If you want to continue to store your data as
DOUBLE PRECISION
, change the data type of the column toDOUBLE PRECISION
either before or after migrating your database to dialect 3. This does not change any functionality in dialect 3, but it brings the declaration into line with the storage mode. In a dialect 3 database, newly-created columns of this type are stored as INT64, but migrated columns are still stored asDOUBLE PRECISION
. Changing the declaration avoids confusion. DOUBLE PRECISION
may not be appropriate or desirable for financial applications and others that are sensitive to rounding errors. In this case, you need to take steps to migrate your column so that it is stored asINT64
in dialect 3. As you make this decision, remember that INT64 does not store the same range asDOUBLE PRECISION
. Check whether you will experience data loss and whether this is acceptable.
- In many cases, the answer is “yes.” If you want to continue to store your data as