Nullable but not null
efe.me
Nullable but not null
1–10 of 49 posts
Re: Nullable but not null
#2Re: Nullable but not null
#3This seems to be the central claim. But just as lies require intent, so does database design to some degree.
A column that is nullable but never null does not conclusively say anything, really. That's like saying a birthday column that is never before 1970 in the current data should be restricted to years after that date.
A nullable column signals that the data may be left empty, which is entirely different from that column actually having to be empty with the current data. Is-ought distinction, the potentiality of null ("nullability") is not to be confused with the actuality of current vacancy ("null values"). The programmer extracting data from the database must check for null if the data is nullable, not just if is null now as a principle of robust fault-tolerant code.
Re: Nullable but not null
#4Re: Nullable but not null
#5> But a field that is nullable in the schema and never null in practice is a silent lie. This seems to be the central claim. But just as lies require intent, so does database design to some degree. A column that is nullable but never null does not conclusively say anything, really. That's like saying a birthday column that is never before 1970 in the current data should be restricted to years after that date. A nulla…
Re: Nullable but not null
#6> But a field that is nullable in the schema and never null in practice is a silent lie. This seems to be the central claim. But just as lies require intent, so does database design to some degree. A column that is nullable but never null does not conclusively say anything, really. That's like saying a birthday column that is never before 1970 in the current data should be restricted to years after that date. A nulla…
Re: Nullable but not null
#7> But a field that is nullable in the schema and never null in practice is a silent lie. This seems to be the central claim. But just as lies require intent, so does database design to some degree. A column that is nullable but never null does not conclusively say anything, really. That's like saying a birthday column that is never before 1970 in the current data should be restricted to years after that date. A nulla…
I think their point is that for all intents, the column IS not nullable. It's nullable as an artifact of making live schema migration easier, with no blocking/downtime. But as the data model is concerned, it should not be nullable.
Re: Nullable but not null
#8> But a field that is nullable in the schema and never null in practice is a silent lie. This seems to be the central claim. But just as lies require intent, so does database design to some degree. A column that is nullable but never null does not conclusively say anything, really. That's like saying a birthday column that is never before 1970 in the current data should be restricted to years after that date. A nulla…
Problem is you end up other places with the assumption thar it's never null. So in the future when you actually set it to null somewhere it will blow up.
Re: Nullable but not null
#9> But a field that is nullable in the schema and never null in practice is a silent lie. This seems to be the central claim. But just as lies require intent, so does database design to some degree. A column that is nullable but never null does not conclusively say anything, really. That's like saying a birthday column that is never before 1970 in the current data should be restricted to years after that date. A nulla…
One could write a separate piece about maybe using that as a clue that the field could be NOT NULL'd in the future but that's not what this post is.
Re: Nullable but not null
#10> But a field that is nullable in the schema and never null in practice is a silent lie. This seems to be the central claim. But just as lies require intent, so does database design to some degree. A column that is nullable but never null does not conclusively say anything, really. That's like saying a birthday column that is never before 1970 in the current data should be restricted to years after that date. A nulla…
No it's not, because they specifically started with the premise that the field was initially intentionally non-null and was only temporarily made nullable for migration purposes. That is obviously not the situation you are describing, right?