Database schema
I have this fields:
Is better set the default value as an empty string '' or a NULL?
For better reading/writing and size-storage performance
The usual contract is:
NULL
means "no information available".''
means "there is information available. It's just empty."Beyond this point there is much philosophical discussion since the invention of NULL
in any language, not just SQL.
The only technical point here is: In PostgreSQL NULL
can be stored more efficiently than a string of length zero. If that really matters in your case ... we cannot know.