Subject Re: [firebird-support] Restoring backup database ( gbak -r some.fbk live.fb ) gives validation error for certain coloum
Author Alexandre Benson Smith
Mohd. Jeffry wrote:

>Dear all,
>
>Does anybody ever encounter below errors when you do "gbak -r
>some-backup.fbk the-real.fb" ? I don't have any clue what causes
>this. This is new to me.
>
>gbak: restoring data for table T_FIN_ITEM_CATEGORY_INVENTORY
> gbak: 7 records restored
> gbak: restoring index PK_T_FIN_ITEM_CATE_SVC_SALE
> gbak: restoring data for table T_FIN_ITEM_CATE_SVC_SALES
> gbak: ERROR: validation error for column TRANSTYPEID, value "*** null ***"
> gbak: ERROR: warning -- record could not be restored
> gbak: Exiting before completion due to errors
> [root@iedb april04]#
>
>
Probably you (or somebody else) added a columns with a not null
constraint and does not update the new column to come value.

or

Modifed the not null constraint of an existing column and not enforced a
value for it.
Hope you still have a working DB then do this:

1.) Update T_FIN_ITEM_CATEGORY_INVENTORY set TRANSTYPEID = <somevalue>
where TRANSTYPEID is null
2.) Perform a new backup
3.) try to restore it again
4.) repeat for each ofending column

FB does not force a default value for a new column with a not null
constraint, I argued if it is good to FB do this, Ann has pointed that
it will penalty every user because of the lazy ones :-)

So be carefull, after creating new column double check you provided
valid values for it, otherwise you will be unable to restore backups. :-(

see you !

--

Alexandre Benson Smith
Development
THOR Software e Comercial Ltda.
Santo Andre - Sao Paulo - Brazil
www.thorsoftware.com.br



--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.9.1 - Release Date: 01/04/2005