Subject | Re: [firebird-support] Firebird 2.5 - Alter table - drop default - bug or feature |
---|---|
Author | Lester Caine |
Post date | 2017-04-25T15:43:32Z |
On 25/04/17 12:51, Maxi maxirobaina@... [firebird-support] wrote:
If you add 'NOT NULL' to an existing field, then you need to populate
the existing fields with a value in the absence of a default. In my book
the existing records start the update for adding a new field with simple
new null records, and FROM A GOOD PRACTICE VIEW I would expect to
populate these empty fields under my control, so the idea that adding
the 'DEFAULT' to a field THEN populates existing fields 'magically' is
wrong, and the way the 'magic' bit would work depends on the order you
process things anyway.
It's not a 'bug' but rather preference and I'm with SET that the process
should include a managed UPDATE rather than a magic one ...
--
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk
> I expect the value assigned by DEFAULT when I add the new field isThere has been various discussions on this area ...
> still there.
If you add 'NOT NULL' to an existing field, then you need to populate
the existing fields with a value in the absence of a default. In my book
the existing records start the update for adding a new field with simple
new null records, and FROM A GOOD PRACTICE VIEW I would expect to
populate these empty fields under my control, so the idea that adding
the 'DEFAULT' to a field THEN populates existing fields 'magically' is
wrong, and the way the 'magic' bit would work depends on the order you
process things anyway.
It's not a 'bug' but rather preference and I'm with SET that the process
should include a managed UPDATE rather than a magic one ...
--
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk