Hello Thomas.

I saw Dimtry´s comment.

About the DEFAULT CLAUSE, even provided, it acts only on new rows and not on preexisting rows. Is this true?

Hugo


On 26/05/2015 02:53, 'Thomas Steinmaurer' t...@iblogmanager.com [firebird-support] wrote:

Hugo,

> Hello.
>
> 1 - I created a column NOT NUL in a table (ALTER TABLE MYTABLE ADD
> NEW_COLUMN INTEGER NOT NULL). There were already some records in the
> table. FB didn´t raise any warning or exception.
> 2 - I created a backup file from MYDB.FDB using gbak. FB didn´t raise
> any warning or exception.
> 3- I tried to restore the backup file to a new MYDB.FDB and FB raises
> and error: gbak: ERROR:validation error for column NAME, value "*** null
> ***"
>
> Let´s accept than the step 3 is coherent.
>
> So, why can I execute step 1 without troubles?
>
> Well, someone can tell me to use -no_validity to restore the database.
> Ok, it works. But, the column that should be NOT NULL will change,
> without warning, and I have to check my tables after restoring DB.
>
> I am using FB 2.5 and I tried using FB 3.0 too.
>
> Is it as I described or there is another way to treat this?

http://tracker.firebirdsql.org/browse/CORE-1748

See Dmitry's InterBase legacy comment.

I for one would simply reject adding new NOT NULL fields on a table with data if there is no DEFAULT clause provided.

--
With regards,
Thomas Steinmaurer
http://www.upscene.com

Professional Tools and Services for Firebird
FB TraceManager, IB LogManager, Database Health Check, Tuning etc.



--


Atenciosamente,

Hugo Eyng

  • [firebird-s... Hugo Eyng hugoe...@msn.com [firebird-support]
    • Re: [f... 'Thomas Steinmaurer' t...@iblogmanager.com [firebird-support]
      • Re... Hugo Eyng hugoe...@msn.com [firebird-support]
      • Re... Hugo Eyng hugoe...@msn.com [firebird-support]
    • [fireb... Dmitry Yemanov dim...@users.sourceforge.net [firebird-support]
      • Re... Hugo Eyng hugoe...@msn.com [firebird-support]

Reply via email to