Subject Re: [firebird-support] Change field type
Author Ivan Prenosil
> You'll come to grief doing it this way around, picking here, picking there.
>
> You'll need to do drop all of the dependencies before you begin (just
> the dependencies, not the objects themselves, except for PSQL
> modules...and make certain you have the up-to-date sources for those
> stored somewhere safe.) It's pretty likely you're going to need to
> repair them as well, since any references to that smallint column
> are hard-wired in the compiled modules.
>
> Then
> create the temp column
> pump in the data from the existing column
> verify the data in the new column
> drop the old column
> create a new column using the old name
> pump in data from tempcolumn and verify
> drop temp column

After removing dependencies, you can change field's type directly by
ALTER TABLE Tab ALTER Col TYPE INTEGER;

>
> After that, go back and recreate the constraints, triggers and SPs.

Ivan