Subject | Re: [firebird-support] Change field type |
---|---|
Author | Ivan Prenosil |
Post date | 2006-09-08T10:52:04Z |
> You'll come to grief doing it this way around, picking here, picking there.After removing dependencies, you can change field's type directly by
>
> 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
ALTER TABLE Tab ALTER Col TYPE INTEGER;
>Ivan
> After that, go back and recreate the constraints, triggers and SPs.