4 ms·
> I agree that NOT NULL should be the default for columns, unfortunately that ship has sailed. Not really. Defaults change all the time. I’m not asking for a f
by pushpop 7y ago
> I agree that NOT NULL should be the default for columns, unfortunately that ship has sailed.
Not really. Defaults change all the time. I’m not asking for a feature to be removed after all.
I don’t deny the change in any specific RDBMS would have to be carefully considered but I’ve worked on a lot harder projects to make transitions in default behaviours than this would be so it’s certainly doable if the momentum was there. However I doubt enough people care enough (if this thread is anything to go by).
> Assuming that the nullable foreign key problem could be solved
Offhand I can think of a few ways to solve that but I also think it’s one of the instances where NULL makes the most sense
> I think that NULL is valuable enough (and not that rare) that it ought to be the database owner's choice whether to allow them or not, as opposed to the superuser (not sure which way you're suggesting).
I completely agree the DBA should still have the power to enable it. My point was just that columns shouldn’t default to being nullable during a CREATE.
To be honest, this could just as easily be “fixed” in graphical database management tools. That would at least enable seasoned DBAs to utilise NULL while preventing others from some of the pitfalls that nullable fields can introduce in some languages. However I still stand by my point that it’s not really a sane default for the way most people architect databases these days (or even “should” be architecting).