Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a new foreign not null field to a populated table [CORE5492] #5761

Open
firebird-automations opened this issue Mar 1, 2017 · 1 comment

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: Alfonso Presa (foncci)

Previosly when updating a table with a script Firebird admitted a to add a not NULL field without a Default value. I understand the reasons why it changed but what about trying to add a NOT NULL Foreign Key to a populated table? Of course it is impossible because you cannot define a Default Value or the data would be inconsistent or you have to use a "non visible row" to accomplish it. This "improvement" is a huge problem for many of us.
I use extensive use of scripts to update my customers and this change ban me from Firebird 3 becasue I cannot find a way to workaround this.

Thanks in advance,

@firebird-automations
Copy link
Collaborator Author

Commented by: Gabor Boros (gaborboros)

First create the new field without NOT NULL. Then set its value to a non null value. After switch on the NOT NULL on the field, for example ALTER TABLE TABLE1 ALTER FIELD1 SET NOT NULL;
Please read "Manage Nullability in Domains and Columns" section in the release notes of 3.0.x.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant