Subject Re: [firebird-support] Firebird 2.5 - Alter table - drop default - bug or feature
Author Maxi


2017-04-24 16:39 GMT-03:00 'Leyne, Sean' Sean@... [firebird-support] <firebird-support@yahoogroups. com>:
 



> 3. Alter the table
> ALTER TABLE "SCHEMA_AUTHOR" ADD "SURNAME" varchar(15) DEFAULT
> 'surname default' NOT NULL
>
> After step 3, I have a record with a new column with 'surname default' value
> into SURNAME field.
>
> 4. Drop default definition
> ALTER TABLE "SCHEMA_AUTHOR" ALTER COLUMN "SURNAME" DROP
> DEFAULT
>
> After step 4, the SURNAME field value is setting to empty string ('')
>
> Is that the correct behavior ?

You dropped the "DEFAULT", what would you expect the system to assign?
 

__,_._,_

I expect the value assigned by DEFAULT  when I add the new field is still there.

I see what there are two different behaviors

1. Adding a new not null field with default value to already populate table
2. Adding a new record (after add the field with default)

Then, when I drop DEFAULT, all pre-existing records lost the value but new record inserted after, maintains the value assigned by default