Subject Re: [firebird-support] Modifying/adding a column default?
Author Avi Schwartz
Martijn Tonies wrote:

> Hi Avi,
>
>
>>I am trying to add a default value to an existing column. Is it
>>possible to do it in FB 1.5.1 or do I have to create a new column, copy
>>the values from the old column to the new one, drop the old column and
>>then rename the new one? This can be a major pain if an index
>>references this column, for example.
>
>
> To add a default, I think there are 4 ways --
>
> 1) create a domain with a default, use the domain instead of a plain
> datatype
>
> 2) add the default to the system generated domain (only if you're using a
> raw datatype)
>
> 3) create a new field/domain and copy the default BLR to the existing
> field.
>
> 4) download Database Workbench and let the GUI do (3) when you enter
> a new default in the Table Editor :-)

Is there any technical reason that FB does not allow altering the
default value of a column directly? Default values kick in only on
inserts and do not affect existing records. Any developer care to share
some insight?

Thanks,
Avi