Subject Re: [firebird-support] GBak Backup & Restore Problem
Author Alexandre Benson Smith
Em 25/6/2013 16:23, Tupy... nambá escreveu:
> Dear Friends,
> We have a strange problem with GBak. We make a backup with gbak and then a restore, also with the same.
> We have a table with 60 rows where a not null type SmallInt column has 0 (zero) as content.
> When restoring, GBak returns null for this column. As this column is not null, we get an error message (Error: Validation error for column .....).
> Between these two steps (backup and restore), no further action is done with the backup file.
> I ask you = What can cause this problem? Is there any solution for this? Any idea about this problem?
> Thanks a lot,
> Roberto Camargo,
> Rio de Janeiro / Brasil

Did the null/not null constraint was applied after the table has some rows ?

IIRC there is something regarding NULL stored and the column be changed
to NOT NULL with a DEFAULT, and so FB will return the DEFAULT value to
NOT NULL columns that in fact is NULL.

I suggest you to do:
update MyTable set MyColumn = 0 where MyColumn is null or MyColumn = 0;

and then perform a new back-up/restore cycle.

see you !