Column Defaults and Column Constraints
From InterBase
Go Up to Method One: In-place Migration
The steps on the parent page permitted you to retain double quoted string constants in column defaults, column constraints, and unnamed table constraints. This is possible because, once created, InterBase stores them in binary form.
Following the steps above creates a dialect 3 database that is fully functional, but if it contains double quoted string constants in column defaults, column constraints, or unnamed column constraints, inconsistencies are visible when you SHOW
metadata or extract it. You can choose to resolve these inconsistencies by following these steps:
- Back up the database.
- Examine the metadata to detect each occurrence of a column default or column constraint that uses double quotes.
- For each affected column, use the
ALTER COLUMN
clause of theALTER TABLE
statement to give the column a temporary name. If column position is likely to be an issue with any of your clients, change the position as well. - Create a new column with the desired data type, giving it the original column name and position.
- Use
UPDATE
to copy the data from old column to the new column:UPDATE table_name SET new_col = old_col;
- Drop the old column.