What would be the default value for a BLOB
since it can contain anything?
Unable to set a default value cannot use this clause in this column type.
On the other hand if the column accepts nulls, then the default value is easy, the NULL
is the standard and there can use, a solution is to use a NULL
, but I would only do this if I needed this and not something else, columns that allow nulls should be avoided, I would not use only to let it have a default value. And neither is the value you want.
If what you want is to put a text, then put the appropriate type. Just understand that TEXT
is the same as a BLOB
and does not accept default value.
You may think you should be able to put a text, but they thought that conceptually it didn’t make sense. There are those who disagree.
Documentation.
What happened? Why vote against? How can I fix, improve...
– user97897
It was not I who denied your question, my guess would be that someone voted negatively because it is a syntax error. In the case column blob does not accept default value and does not have much more to discuss about it except resolve via Trigger in the bank or in its own application.
– Rafael Mena Barreto
@user97897 The answer solved your question? Do you think you can accept it? See [tour] if you don’t know how to do it. This would help a lot to indicate that the solution was useful for you. You can also vote on any question or answer you find useful on the entire site (when you have 15 points).
– Maniero